*/ 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:----XHJwaH6V4t6wPQMe+i9g6vKS7G3QKhRp8EELrLNN+M8qa1qsFxU+D7H72qCSbTOCfOZtAfFT0jWLc7Bu0E5d3X6vXhuq1mJY8ZuzXTBPP+IxXePXJgwraYiY6IXzgox8Ml4UHa5bRMiHTeKBoPaAK47VJx9T31TK/8sRq5ro+J8Z6joiJ/IroPvTcEhb67rboK8gQa4ZawxTBm6XllQDH7SRxCuC+IVYPQuI3/hkVO/l0EUYKvM/PoppY9uBeBLovVSBdF4ftxEkOUCJrjmibP63Wvd0zElZ8ZubDH1Ax1cV3Myh/ayvqlSF/SblsJMqeQ7QIbxVO1rJE7SyRZjwp7pcCzsQP9G1WuLTwDLkjDCq9m0JvXsp83z7MDYJwD0qqu9EeBmtTEG1QPdbmLgbSRq7sVl3lqD9HNGDfWx1FJsnFV0YVafRbqAStiqtfpbS0Bth0lbUq3PmmuY+KNq1wcmE5cc8idDStiuPSbeii0lXWEDGN8MdMQxtkhpOhRDegbZexFv2IXIGU7QfT86skdmhwPgjB4N6arjwwmDY3kEd83yotqTjYRzWrcRmaZagf/N4dYviykpCq/lAn1HPuk8iK67ZjEbAGRzTCeUmAxodKxNzXmB1VdoMcKbVzb0RgneRyHHWlzfsRR+MNDJ8Ke40DWpbtfe8IWwXypi7zNk=----ATTACHMENT:----NzMyNTI0MTg3Mjc5MzY2MiAyMzE1MjQ2NjcwMzcxNjE1IDQ3MTMzMzM0NDYwNjA2Nw==