matcherDefinitions = $matcherDefinitions; $this->validateMatcherDefinitions(); } /** * Called by PhpParser. */ public function enterNode(Node $node): null { if (!$this->isFileIgnored($node) && !$this->isLineIgnored($node) && $node instanceof ConstFetch && array_key_exists($node->name->toString(), $this->matcherDefinitions) ) { // Access to constants is detected as strong match $this->matches[] = [ 'restFiles' => $this->matcherDefinitions[$node->name->toString()]['restFiles'], 'line' => $node->getAttribute('startLine'), 'message' => 'Call to global constant "' . $node->name->toString() . '"', 'indicator' => 'strong', ]; } return null; } }