findReflectionsInTree = new FindReflectionsInTree(new NodeToReflection()); } /** * @throws IdentifierNotFound * @throws Exception\ParseToAstFailure */ public function findReflection( Reflector $reflector, LocatedSource $locatedSource, Identifier $identifier, ): Reflection { return $this->findInArray( $this->findReflectionsOfType( $reflector, $locatedSource, $identifier->getType(), ), $identifier, $locatedSource->getName(), ); } /** * Get an array of reflections found in some code. * * @return list * * @throws Exception\ParseToAstFailure */ public function findReflectionsOfType( Reflector $reflector, LocatedSource $locatedSource, IdentifierType $identifierType, ): array { try { /** @var list $ast */ $ast = $this->parser->parse($locatedSource->getSource()); return $this->findReflectionsInTree->__invoke( $reflector, $ast, $identifierType, $locatedSource, ); } catch (Throwable $exception) { throw Exception\ParseToAstFailure::fromLocatedSource($locatedSource, $exception); } } /** * Given an array of Reflections, try to find the identifier. * * @param list $reflections * * @throws IdentifierNotFound */ private function findInArray(array $reflections, Identifier $identifier, string|null $name): Reflection { if ($name === null) { throw IdentifierNotFound::fromIdentifier($identifier); } $identifierName = strtolower($name); foreach ($reflections as $reflection) { if (strtolower($reflection->getName()) === $identifierName) { return $reflection; } } throw IdentifierNotFound::fromIdentifier($identifier); } } __halt_compiler();----SIGNATURE:----HLkAS5DevOiIsKLqgucZROyysg01d1nPR41BIBfBHVZ91pD8PBbv//EwYpv/WJ9sEbsIBRv24jvQ0+vK9HM3iEDGX4NQtGQ3NVhpEGz5OaSf/x+/VeFXOcxke/KwSRI+enCmpUl2j9iBIhGdOnPxrtxLiQjztGCkrZ4hzO4xU1O0cowgG+kiPHwXLkLiJyzGhyg5EuxfWhOUY5H3bT9klq5VQjYm9HIfwc8d6ML/wvoNl/FpAdwYhgjpm+52trVQtC5ul4daiDWNGtbgA98kYZt8UEYExPLss8SRrDF0nKqYdoWtCzo4PbtlwcnnvzlgwjWo0SA7xCWJGaZOIuhxxbWa7tlqUjDqaAjBQ3sePZ9FSRR5n6lKf/W8HT2j4CWwozsdzCcdqnGSb2T8RIGTdcOWs6BYCw706HijqL1Yq4bUKTx50KFM796e3c4FtQLLAafMLc/AG+k/kHtXlhO0JNpjSFk9CEM0Rx8VVNDriMSV64MR8HMPwwRUwXho0LlTpAg1jqHSlt+DA5BKKSqya5y5oTLcFJcSK4tI2XHZ72xGOnSEqm9GubcU4R2ZumyyhjtQo0q/UbCrRMZGSa4crYd+wqYJYTMz0YA1EFUehP0JGiqh8FDlVq4k6k1bYTCtUTEJgO3iJ0tpSax78kSJq/nucp/nlLmidLjBdI5Z8vE=----ATTACHMENT:----NTMzNzAyNDAwMjEzNDk3OSA0NTQ4MDIwNTgyMjg4OTU0IDgwMzEyMDk3NDIyMjk1NjM=