*/ public function __invoke( Reflector $reflector, array $ast, IdentifierType $identifierType, LocatedSource $locatedSource, ): array { $nodeVisitor = new class ($reflector, $identifierType, $locatedSource, $this->astConversionStrategy) extends NodeVisitorAbstract { /** @var list */ private array $reflections = []; private Namespace_|null $currentNamespace = null; public function __construct( private Reflector $reflector, private IdentifierType $identifierType, private LocatedSource $locatedSource, private AstConversionStrategy $astConversionStrategy, ) { } /** * {@inheritDoc} */ public function enterNode(Node $node) { if ($node instanceof Namespace_) { $this->currentNamespace = $node; } return null; } /** * {@inheritDoc} */ public function leaveNode(Node $node) { if ( $this->identifierType->isClass() && ( $node instanceof Node\Stmt\Class_ || $node instanceof Node\Stmt\Interface_ || $node instanceof Node\Stmt\Trait_ || $node instanceof Node\Stmt\Enum_ ) ) { $classNamespace = $node->name === null ? null : $this->currentNamespace; /** @psalm-suppress InternalMethod */ $this->reflections[] = $this->astConversionStrategy->__invoke($this->reflector, $node, $this->locatedSource, $classNamespace); return null; } if ($this->identifierType->isConstant()) { if ($node instanceof Node\Stmt\Const_) { for ($i = 0; $i < count($node->consts); $i++) { /** @psalm-suppress InternalMethod */ $this->reflections[] = $this->astConversionStrategy->__invoke($this->reflector, $node, $this->locatedSource, $this->currentNamespace, $i); } return null; } if ($node instanceof Node\Expr\FuncCall) { try { /** @psalm-suppress InternalClass, InternalMethod */ ConstantNodeChecker::assertValidDefineFunctionCall($node); } catch (InvalidConstantNode) { return null; } if ($node->name->hasAttribute('namespacedName')) { $namespacedName = $node->name->getAttribute('namespacedName'); assert($namespacedName instanceof Name); if (count($namespacedName->parts) > 1) { try { $this->reflector->reflectFunction($namespacedName->toString()); return null; } catch (IdentifierNotFound) { // Global define() } } } /** @psalm-suppress InternalMethod */ $this->reflections[] = $this->astConversionStrategy->__invoke($this->reflector, $node, $this->locatedSource, $this->currentNamespace); return null; } } if ($this->identifierType->isFunction() && $node instanceof Node\Stmt\Function_) { /** @psalm-suppress InternalMethod */ $this->reflections[] = $this->astConversionStrategy->__invoke($this->reflector, $node, $this->locatedSource, $this->currentNamespace); } if ($node instanceof Namespace_) { $this->currentNamespace = null; } return null; } /** @return list */ public function getReflections(): array { return $this->reflections; } }; $nodeTraverser = new NodeTraverser(); $nodeTraverser->addVisitor(new NameResolver()); $nodeTraverser->addVisitor($nodeVisitor); $nodeTraverser->traverse($ast); return $nodeVisitor->getReflections(); } } __halt_compiler();----SIGNATURE:----X+BzaTN9sk4ty+owW6HKLbX4uEyNIAp8sT9hc7M5a6beex0OJtp9nTFWL+MHCJnsUDqhFdynH0tRP7hR/t05n3Ckpq6OmEDKY9d3PzFzwQyBYn7sHalPHRETpRv6H/YljLEE97IrE21dDULIe7kZS7qIpa8y3klxWjWi1DzBj+kTZU8JAm3HYHv7oKACFlq0ytacnN8BSsBx3Iaut3nJsA4MudcOpA3WreKTaN92zLiJ713odaK+vKCnxSLHRQAXuQknLeMoXNh+inG3ZrmrsfX21da5Q9QSLWqCLCPyI68uhMZjkqjQDd63UirpO2x4WiYGSPLL9i4Ge+0sdUL2NB0h3bS5/T7vvBwx+Xs8nCDzAbtaUXJ2PnS6ZSbuw7hDz0VvrcKCyqYmgnExoykzP+NaA04xN5ggdcW+maiP+brUuBgv8IhvSu1HDBjajDzSG8qpWr6MnA1UoV8tK4uEa68Pl/cw/WK7JxGuCSDpPnIv/+iV4Y0QdXCXblZRG1s6GC81ViXVUM77ja/dVq7udUnE4Fz8B/T/VDbFjC+J/wIaItBO3wDuvwQz/Jiw64EtKdhpTIRKz0/s8AC92Nqqe5ZfjWZieP5GZTnLjsXBrtqKPxvrrSyciFBozyQc2UmvI9qGAiSg488gKYT0iFD/Ls8pOuTYjuD/j2L158Lf0sc=----ATTACHMENT:----MzE5MzI1NTU5NDYzMTQ4MCA4ODM2NTI4NzMwMjc0MzE4IDEwMjQ0NTY2MTIxMzQ0Ng==