Bind variable when option is a super global

@param string $option
@param mixed  $value   OUTPUT
@return boolean
10954
protected function bindVarSuperGlobal($option, ServerRequestInterface $request, &$value)
    {
        if (preg_match('/^\$_(GET|POST|COOKIE)\[([^\[]*)\]$/i', $option, $matches)) {
            list(, $var, $key) = $matches;

            $var = strtolower($var);
            $data = null;

            if ($var === 'get') {
                $data = $request->getQueryParams();                
            } elseif ($var === 'post') {
                $data = $request->getParsedBody();
            } elseif ($var === 'cookie') {
                $data = $request->getCookieParams();
            }

            $value = isset($data[$key]) ? [$data[$key]] : null;
            return true;
        }
        
        return false;
    }
1048734
public function setOption(int $option, $value) : void
    {
        curl_setopt($this->curl, $option, $value);
    }
1329462
public function setValue($value) {
        global $DB;
        $values = (array) $value;
        $ids = array();

        foreach ($values as $onevalue) {
            if (!empty($onevalue) && (!$this->optionExists($onevalue)) &&
                    ($onevalue !== '_qf__force_multiselect_submission')) {
                array_push($ids, $onevalue);
            }
        }

        if (empty($ids)) {
            return $this->setSelected(array());
        }

        // Logic here is simulating API.
        $toselect = array();
        list($insql, $inparams) = $DB->get_in_or_equal($ids, SQL_PARAMS_NAMED, 'param');
        $frameworks = competency_framework::get_records_select("id $insql", $inparams, 'shortname');
        foreach ($frameworks as $framework) {
            if (!has_any_capability(array('moodle/competency:competencyview', 'moodle/competency:competencymanage'),
                    $framework->get_context())) {
                continue;
            } else if ($this->onlyvisible && !$framework->get('visible')) {
                continue;
            }
            $this->addOption($framework->get('shortname') . ' ' . $framework->get('idnumber'), $framework->get('id'));
            array_push($toselect, $framework->get('id'));
        }

        return $this->setSelected($toselect);
    }
288266
public static function options( $name = '', $value = '' ) {

		if ( ! empty( $value ) ) {
			$GLOBALS['_OPTIONS'][ $name ] = $value;
		}

		if ( empty( $name ) ) {
			return ( isset( $GLOBALS['_OPTIONS'] ) ) ? $GLOBALS['_OPTIONS'] : NULL;
		} else {
			return ( isset( $GLOBALS['_OPTIONS'][ $name ] ) ) ? $GLOBALS['_OPTIONS'][ $value ] : NULL;
		}

	}
1106301
public function bindValue($parameter, $value, $data_type = PDO::PARAM_STR)
    {
        $this->bindings->push(
            $this->wye->makeBinding($parameter, $value, $data_type)
        );

        return true;
    }
436438
public function setGlobalVariable($variable = NULL, $value = NULL)
	{
		try {

			$result = FALSE;

			if (is_null($variable))
				throw new Exception("Global variable name not provided or is null", 503);

			if (is_null($value))
				throw new Exception("Global variable value not provided or is null", 503);

			$uri = "/asterisk/variable";
			$postData = array("variable" => $variable, "value" => $value);

			$this->ariEndpointOptions['json'] = $postData;
			$result = json_decode($this->ariEndpointClient->post($this->ariEndpointURL . $uri, $this->ariEndpointOptions)->getBody()->getContents());

			return $result;

		} catch (\GuzzleHttp\Exception\RequestException $e) {
			$this->phpariObject->lasterror = $e->getMessage();
			$this->phpariObject->lasttrace = $e->getTraceAsString();
			return (int)$e->getCode();
		} catch (\GuzzleHttp\Exception\ClientException $e) {
			$this->phpariObject->lasterror = $e->getMessage();
			$this->phpariObject->lasttrace = $e->getTraceAsString();
			return (int)$e->getCode();
		} catch (\GuzzleHttp\Exception\ServerException $e) {
			$this->phpariObject->lasterror = $e->getMessage();
			$this->phpariObject->lasttrace = $e->getTraceAsString();
			return (int)$e->getCode();
		} catch (Exception $e) {
			$this->phpariObject->lasterror = $e->getMessage();
			$this->phpariObject->lasttrace = $e->getTraceAsString();

			return FALSE;
		}
	}
22209
protected function prepareValue($value)
    {
        switch (gettype($value)) {
            case OptionInterface::TYPE_BOOLEAN:
                return ($value) ? 'true' : 'false';
            case OptionInterface::TYPE_NUMBER:
                return $value;
            case OptionInterface::TYPE_STRING:
                return "'" . $value . "'";
        }
    }
91719
public function customDefault ($value, $default, $option = null) {
		switch ($option) {
			case 'twig':
			case 'default':
				return $value ?: $default;
			case 'empty':
				return empty($value) ? $default : $value;
			case 'string':
				return ($value !== '' && $value !== null) ? $value : $default;
			case 'null':
			default:
				return ($value === null) ? $default : $value;
		}
	}
124175
public static function setGlobal($key, $value = null)
    {
        if (is_array($key))
        {
            foreach ($key as $key2 => $value)
            {
                self::$_globalData[$key2] = $value;
            }
        }
        else
        {
            self::$_globalData[$key] = $value;
        }
    }
598634
public function setCurlOption($option, $value)
    {
        $this->debug("setCurlOption option=$option, value=");
        $this->appendDebug($this->varDump($value));
        curl_setopt($this->ch, $option, $value);
    }
797044
public function setOption($option, $value = '')
    {
        if (is_array($option)) {
            foreach ($option as $key => $value) {
                $this->options[$key] = $value;
            }
        }
        else {
            $this->options[$option] = $value;
        }

        return $this;
    }
670522
public function setOption(string $option, $value) {
        $this->validateOption($option, $value);
        $this->options[$option] = $value;
    }
1337769
public function setOptions($option, $value = null) 
	{
		Argument::i()
			->test(1, 'array', 'string')
			->test(2, 'scalar', 'null');
		
		if(is_array($option)) {
			$this->options = $option;
			return $this;
		}
		
		$this->options[$option] = $value;
		return $this;
	}
804250
public function bindValue($value): void
    {
        if ($this->getPDOType($value) === false) {
            throw new \Exception(gettype($value) . " is an invalid type to bind. ");
        }

        $this->bindedValues[] = $value;
    }
413408
public static function set_global($name, $value = null)
    {
        if (isset($name) && is_array($name)) {
            foreach ($name as $n => $v) {
                self::$global[$n] = $v;
            }
        } else {
            self::$global[$name] = $value;
        }
    }
638413
public function setOption($option, $value)
    {
        if ($this->isValidOption($option)) {
            $this->options[$option] = $value;
        }

        return $this;
    }
276467
function setValue($value) {
        $values = (array) $value;
        foreach ($values as $onevalue) {
            if (($this->tags || $this->ajax) &&
                    (!$this->optionExists($onevalue)) &&
                    ($onevalue !== '_qf__force_multiselect_submission')) {
                $this->addOption($onevalue, $onevalue);
            }
        }
        return parent::setValue($value);
    }