overridenFunctions = []; StubParser::processStubs( $this, null, fn (SplFileInfo $file): bool => $file->getFilename() === '.phpstorm.meta.php' ); } /** * @throws RuntimeException */ public function enterNode(Node $node): void { if ($node instanceof Node\Expr\FuncCall && (string)$node->name === self::OVERRIDE_FUNCTION) { $args = $node->args; if (count($args) < 2) { throw new RuntimeException('Expected at least 2 arguments for override call'); } $this->overridenFunctions[] = self::getOverrideFunctionName($args[0]); } } private static function getOverrideFunctionName(Node\Arg $param): string { $paramValue = $param->value; if ($paramValue instanceof Expr\StaticCall) { $targetFunction = $paramValue->class . '::' . $paramValue->name; } else { $targetFunction = (string)$paramValue->name; } return $targetFunction; } }