computeReflections($filename); foreach ($reflections as $reflection) { if ($reflection instanceof ReflectionClass && $this->containsLine($reflection, $lineNumber)) { foreach ($reflection->getMethods() as $method) { if ($this->containsLine($method, $lineNumber)) { return $method; } } return $reflection; } if ($reflection instanceof ReflectionFunction && $this->containsLine($reflection, $lineNumber)) { return $reflection; } if ($reflection instanceof ReflectionConstant && $this->containsLine($reflection, $lineNumber)) { return $reflection; } } return null; } /** * Find all class and function reflections in the specified file * * @param non-empty-string $filename * * @return list * * @throws ParseToAstFailure * @throws InvalidFileLocation */ private function computeReflections(string $filename): array { $singleFileSourceLocator = new SingleFileSourceLocator($filename, $this->astLocator); $reflector = new DefaultReflector(new AggregateSourceLocator([$singleFileSourceLocator, $this->sourceLocator])); return array_merge( $singleFileSourceLocator->locateIdentifiersByType($reflector, new IdentifierType(IdentifierType::IDENTIFIER_CLASS)), $singleFileSourceLocator->locateIdentifiersByType($reflector, new IdentifierType(IdentifierType::IDENTIFIER_FUNCTION)), $singleFileSourceLocator->locateIdentifiersByType($reflector, new IdentifierType(IdentifierType::IDENTIFIER_CONSTANT)), ); } /** * Check to see if the line is within the boundaries of the reflection specified. */ private function containsLine(ReflectionClass|ReflectionMethod|ReflectionFunction|ReflectionConstant $reflection, int $lineNumber): bool { return $lineNumber >= $reflection->getStartLine() && $lineNumber <= $reflection->getEndLine(); } } __halt_compiler();----SIGNATURE:----T+FlXabJ77lS7ElyXbewHcCLID9vF07sWIptmYpPW6TIyt+SpDqICIWq840aXCRQvYwEYFQhufj6dNGod6OFL4uE6oLvkiH4LhQXbgLGh+udhT0vNzME3iwnFgcpmKVEdpkg4cq8H+wgL+ovDFLTdIamdKA/cPF/ZWKfuylnpUVFgmbPdt+40DUayhR8enfMWmJMbNhMapVgQPwhDESd8vA20AaVv4YYh3tg0JspUiwq8jV4Jv+NCWiyCneTzMLBRPecyAribVA2VnOoQSf0XHDp1qlX+5ZfBEnYXYtytpU3t7CjRhYgyQ21EU2CTw5ChiR0y4omGqskievsmgu8ICHJ7lU6GhhA7luWxKsVV/SO3oFHugmIizyPR8pEcVse6Oh2taeLXBgOc8Tz/v5U9v+6ohDwNtFSikjSoHcSK3Ct/+60f/wk2y4wNMb/gBJ0dvMECUU9gVyKB2ruQ5PXuqiM4EL/gVyieJrEKa3IK+IWQTek4tK5pHxSAolN3tISXUhFBSH+odo0aqU23XEd8j7I6lUd57uffyJFjdg4N3P6AQALJq+NLKmUXZV8N5UA3dggt3zEDtNwN+9L8oy/WbPixfpUHd8lECy02pPiWt3RKnTN6MrInfq1KFPkZyB+uWTEYXgNzP2V3H31G3nCKIb9i6KL+/PsZq0RNBiKgT4=----ATTACHMENT:----NjgyMjE0NzQxMjExMjA1NSA5NTQ3MTg2Mjk2ODA4NDUzIDQxNjcxNjk1NTY1NTk5Mzc=