*/ 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:----Sz0Lpk0PmZbwENspNXG1+a3ES9XEuR3qfoEqbGXoFp4uBoAB/MZQFgITU5xFbLcXXzo22GgewVUGaqdKOcZbCf/Gh/dE80JzflHuzEWI7tpp+kIzxYxFYsXrME1mLNZAo2PGdZ8XxNxyn1YO1EymmstQ6x0jSYk6bJ+uvNwoaeRShMjadDKW/CTkI3xjcMB9d/KWK8PBRe4MVnq1clwRuFRyYuZI5HxV9rrlZrMPDz+xEeAqhJwHdbLZbL9kWeCKyYphU8Ab0mLCUn+AnmSFlsw66duf/Voz822Q3vvv85fDUoycEhaNM5ZVd9+qARroi/w5NIaHX4hPDeK3DSDbalEYFF9o44Alx5cI5r3xeAUE8hB+TYnWCMWYiM3ejSBo8Sg2i7hasEbQHL/7Fj7z+duuwrd5B8OebrggHuVFHzfmJxOxOfPC5HH45ZyC2+0s1pWQWwpRgWHymBMcvvZTg4lL3InQa6PDkfdjIiR4Qe/b2Jc3qjXsadTqAQOSPtxOLMBO4jxrozlINDrFuoFqEegdSYbi+mrjcRwZEnxC1QlPVTKEU0Tq1gSs83N2yTVxiShONROYqvpVMvA1Z7i8Bwjxx0nROg3MFwKnE79kZyLJZPmLrD79ur1Zl1MbBAAWSIocvdo5MH8mN2oQ15k8ipcLr7CFhQ0L5sxBAFe6UkE=----ATTACHMENT:----NzI1NjQxODc0MzM5MzI4NiAyNDc0MDQ0ODk5MzQ5MDA3IDYwMjUwMzYzMDA2OTA2MzM=