matcherDefinitions = $matcherDefinitions; $this->validateMatcherDefinitions(); } /** * Called by PhpParser. * * @param Node $node Given node to test */ public function enterNode(Node $node): null { if (!$this->isFileIgnored($node) && !$this->isLineIgnored($node) && $node instanceof FullyQualified ) { $fullyQualifiedClassName = $node->toString(); if (array_key_exists($fullyQualifiedClassName, $this->matcherDefinitions)) { $this->matches[] = [ 'restFiles' => $this->matcherDefinitions[$fullyQualifiedClassName]['restFiles'], 'line' => $node->getAttribute('startLine'), 'message' => 'Usage of class "' . $fullyQualifiedClassName . '"', 'indicator' => 'strong', ]; } } return null; } }