@param GlobalVariables $globalVariable

@return TokenInterface|null
500484
private static function getToken(GlobalVariables $globalVariable)
    {
        if (!$globalVariable->get('container')->has('security.token_storage')) {
            return;
        }

        return $globalVariable->get('container')->get('security.token_storage')->getToken();
    }
288886
public static function createFromGlobalsResolveCLIRequest(array $globals = null) : Request
    {
        $globals = static::manipulateIfCLIRequest(
            ($globals === null
                ? Uri::fixSchemeProxyFromGlobals($_SERVER)
                : $globals
            )
        );

        return static::createFromGlobals($globals);
    }
145360
private function globalVar() {
    if ($this->currentType === T_VARIABLE) {
      return $this->mustMatchToken(T_VARIABLE);
    }
    elseif ($this->currentType === '$') {
      if ($this->isLookAhead('{')) {
        return $this->_compoundVariable();
      }
      else {
        $node = new VariableVariableNode();
        $this->mustMatch('$', $node);
        $node->addChild($this->variable());
        return $node;
      }
    }
    throw new ParserException(
      $this->filename,
      $this->iterator->getLineNumber(),
      $this->iterator->getColumnNumber(),
      'expected a global variable (eg. T_VARIABLE)');
  }
44908
public function RemoveGlobalVariable($name, $namespace="", $header="")
    {
        if($header)
        {
            if($namespace)
            {
                unset($this->headers[$header]->namespaces[$namespace]->global_variables[$name]);
            }
            else
            {
                foreach($this->headers[$header]->namespaces as $namespace_object)
                {
                    unset($namespace_object->global_variables[$name]);
                }
            }
        }
        elseif($namespace)
        {
            foreach($this->headers as $header_object)
            {
                unset($header_object->namespaces[$namespace]->global_variables[$name]);
            }
        }
        else
        {
            foreach($this->headers as $header_object)
            {
                foreach($header_object->namespaces as $namespace_object)
                {
                    unset($namespace_object->global_variables[$name]);
                }
            }
        }
        
        return false;
    }
952053
function cleanSuperGlobalVariables()
    {
        if (isset($_GET)) $_GET = array();
        if (isset($_POST)) $_POST = array();
        if (isset($_COOKIE)) $_COOKIE = array();
        if (isset($_FILES)) $_FILES = array();
        if (isset($_ENV)) $_ENV = array();
        if (isset($_REQUEST)) $_REQUEST = array();
        if (isset($_SERVER)) $_SERVER = array();
        if (isset($_SESSION)) $_SESSION = array();
        if (isset($GLOBALS)) $GLOBALS = array();
    }
934020
protected function getPresenterMethodFromVariable($variable)
    {
        $method = 'present'.str_replace(' ', '', ucwords(str_replace(['-', '_'], ' ', $variable)));
        if (method_exists($this, $method)) {
            return $method;
        }
    }
1312609
public function &_GLOBALS($k, $v=null)
    {
        if (!isset($this->GLOBALS[$k])) {
            $this->GLOBALS[$k]=$v;
        }
        return $this->GLOBALS[$k];
    }
401892
public static function getGlobal(string $name)
    {
        if (isset(self::$globalOptions[$name])) {
            return self::$globalOptions[$name];
        } else {
            return null;
        }
    }
979730
protected function addGlobalCode($globalCode, $priority = PHP_INT_MAX) {
        if (!empty($globalCode)) {
            $code = new Code();
            $code->setCode($globalCode)
                 ->setPriority($priority);
            $this->builder->addGlobalCode($code);
        }
        return $this;
    }
1237684
public static function getModuleResultData( $var, $default=null )
    {
        if ( isset( $GLOBALS['moduleResult'] ) )
        {
            $data = $GLOBALS['moduleResult'];
            if ( strpos( $var, 'content_info/' ) === 0 )
            {
                if ( !isset( $data['content_info'] ) )
                {
                    // no need to log warnings here, as content_info is not always set
                    return $default;
                }
                $data = $data['content_info'];
            }
            $parts = explode( '/', $var, 3 );
            $value = isset( $data[$parts[1]] ) ? $data[$parts[1]] : $default;
            if ( is_array( $value ) && isset( $parts[2] ) )
            {
                $value = $value[$parts[2]];
            }
            return $value;
        }
        else
        {
            eZPerfLoggerDebug::writeWarning( 'Can not recover module result data, global variable "moduleResult" not found. Are you on eZ 5.0 or later?', __METHOD__ );
            return $default;
        }
    }
446704
private function createGlobalSubject()
    {
        if (null !== $home = $this->pageHelper->getHomePage()) {
            return $this->createSubjectFromPage($home);
        }
        return null;
    }
312535
public function codes($variable)
    {
        foreach ($this->keywordList('CODES') as $keyword) {
            if ($keyword->subKeys[0] == $variable) {
                return $keyword->values;
            }
        }

        return null;
    }
579788
public function resolveVariableToNode($var)
    {
        $n = $var;
        // When a use is passed, start outside the closure to not return immediately
        // Use variable vs variable parsing?
        if ($var instanceof Node\UseVariableName) {
            $n = $var->getFirstAncestor(Node\Expression\AnonymousFunctionCreationExpression::class)->parent;
            $name = $var->getName();
        } else if ($var instanceof Node\Expression\Variable || $var instanceof Node\Parameter) {
            $name = $var->getName();
        } else {
            throw new \InvalidArgumentException('$var must be Variable, Param or ClosureUse, not ' . get_class($var));
        }
        if (empty($name)) {
            return null;
        }

        $shouldDescend = function ($nodeToDescand) {
            // Make sure not to decend into functions or classes (they represent a scope boundary)
            return !($nodeToDescand instanceof PhpParser\FunctionLike || $nodeToDescand instanceof PhpParser\ClassLike);
        };

        // Traverse the AST up
        do {
            // If a function is met, check the parameters and use statements
            if ($n instanceof PhpParser\FunctionLike) {
                if ($n->parameters !== null) {
                    foreach ($n->parameters->getElements() as $param) {
                        if ($param->getName() === $name) {
                            return $param;
                        }
                    }
                }
                // If it is a closure, also check use statements
                if ($n instanceof Node\Expression\AnonymousFunctionCreationExpression &&
                    $n->anonymousFunctionUseClause !== null &&
                    $n->anonymousFunctionUseClause->useVariableNameList !== null) {
                    foreach ($n->anonymousFunctionUseClause->useVariableNameList->getElements() as $use) {
                        if ($use->getName() === $name) {
                            return $use;
                        }
                    }
                }
                break;
            }

            // Check each previous sibling node and their descendents for a variable assignment to that variable
            // Each previous sibling could contain a declaration of the variable
            while (($prevSibling = $n->getPreviousSibling()) !== null && $n = $prevSibling) {

                // Check the sibling itself
                if (self::isVariableDeclaration($n, $name)) {
                    return $n;
                }

                // Check descendant of this sibling (e.g. the children of a previous if block)
                foreach ($n->getDescendantNodes($shouldDescend) as $descendant) {
                    if (self::isVariableDeclaration($descendant, $name)) {
                        return $descendant;
                    }
                }
            }
        } while (isset($n) && $n = $n->parent);
        // Return null if nothing was found
        return null;
    }
988513
def get_global_variable(self, name):
        
        p = ffi.lib.LLVMPY_GetNamedGlobalVariable(self, _encode_string(name))
        if not p:
            raise NameError(name)
        return ValueRef(p, 'global', dict(module=self))
1113240
public function get($name = '')
    {
        if ($name == '') return $this->_get;

        if ($this->getExists($name)) return $_GET[$name];

        throw new GlobalGetKeyNotFoundException('\'' . $name . '\'' . ' key does not exist in $_GET superglobal variable');
    }
527817
private function _checkVariableVariable($token) {
		if ($this->_isActive('variableVariable')) {

			if ($this->tokenizer->checkNextToken(T_VARIABLE)) {
				$msg = $this->_getMessage("VARIABLE_VARIABLE", '$' . $this->tokenizer->peekNextToken()->text);
				$this->_writeError('variableVariable', $msg);
			}
		}
	}
726032
protected Map<String, Object> getGlobalVariables(KnowledgeRuntimeEngine runtimeEngine) {
        Map<String, Object> globalVariables = new HashMap<String, Object>();
        if (runtimeEngine != null) {
            Globals globals = runtimeEngine.getSessionGlobals();
            if (globals != null) {
                for (String key : globals.getGlobalKeys()) {
                    Object value = globals.get(key);
                    globalVariables.put(key, value);
                }
            }
        }
        return globalVariables;
    }