matcherDefinitions = $matcherDefinitions; $this->validateMatcherDefinitions(); } /** * Called by PhpParser. */ public function enterNode(Node $node): null { if (!$this->isFileIgnored($node) && !$this->isLineIgnored($node) && $node instanceof Property && $node->isStatic() && !$node->isPrivate() && array_key_exists($node->props[0]->name->name, $this->matcherDefinitions) ) { $propertyName = $node->props[0]->name->name; $match = [ 'restFiles' => $this->matcherDefinitions[$propertyName]['restFiles'], 'line' => $node->getAttribute('startLine'), 'message' => 'Use of property "' . $node->props[0]->name->name . '"', 'indicator' => 'weak', ]; $this->matches[] = $match; } return null; } }