matcherDefinitions = $matcherDefinitions; $this->validateMatcherDefinitions(); } /** * Called by PhpParser. */ public function enterNode(Node $node): null { if (!$this->isFileIgnored($node) && !$this->isLineIgnored($node) && $node instanceof ClassConstFetch && $node->class instanceof FullyQualified && array_key_exists($node->class->toString() . '::' . $node->name, $this->matcherDefinitions) ) { // No weak test implemented - combination class::const name tested $this->matches[] = [ 'restFiles' => $this->matcherDefinitions[$node->class->toString() . '::' . $node->name]['restFiles'], 'line' => $node->getAttribute('startLine'), 'message' => 'Call to class constant "' . $node->class->toString() . '::' . $node->name . '"', 'indicator' => 'strong', ]; } return null; } }