matcherDefinitions = $matcherDefinitions; $this->validateMatcherDefinitions(); } /** * Called by PhpParser. */ public function enterNode(Node $node): null { if (!$this->isFileIgnored($node) && !$this->isLineIgnored($node) && $node instanceof ArrayDimFetch && $node->var instanceof Variable && $node->var->name === 'GLOBALS' && $node->dim instanceof String_ && array_key_exists('$GLOBALS[\'' . $node->dim->value . '\']', $this->matcherDefinitions) ) { $this->matches[] = [ 'restFiles' => $this->matcherDefinitions['$GLOBALS[\'' . $node->dim->value . '\']']['restFiles'], 'line' => $node->getAttribute('startLine'), 'message' => 'Access to array global array "' . $node->dim->value . '"', 'indicator' => 'strong', ]; } return null; } }