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:----WagBNvKG68epKTF9a9ihDJ8XLdiPmZ6ayRljPKVOeWoLwasrfEx2iO2H+7gTq3j0wbXVSyNgmrvKov3Pzk3FqAtW/Voj5UBN5PU1Zx+Jvlehqk39o4WbQgndSxyXVSWVAJLyC2snMjL23DswRkkCLZsq8lNcVyP0qajgdCSdPPiJ8tAh923gaine5mPfntUAnT+InIuJJ5sylqlLxroXJar7WlPgjNRzk6TER2+gYbxy7DpsC+Q3KK8HHrVNtk+6LmyMvaZ80UuWF9OU6n4ha1XqFes9kED6EEhMa6hR2mcqCEk7cgTKAGgNG+6f+n092hIvcYZzqKR3oQmSQfFOe3N6zuq8jnPjlnhUeiyJPir40sVtOigJC1H1572AtG5jFNRBK4KYzmtTmOYFxBot2o+YrJJrMpyCr4O896ktH2cwZTABw75WEZTfNmi/7lqMUOl5GSZLK2Ha5QanQlHpwI0TKrFjdQj2GKiNY2MWUJ2j9d4r2QGPOxsSsKOG8FT5PJiwUhhday1c/JTifC/W+WlY9jEEe0N5mEKe0vZSq9RDmTbI9XATem4b8dSsy+WOgOneddejusI8SLCc4p0cVd1sv14aZSr9GwWqRguCWL/iIepBH9wSBCKD62K6K1eLhdqQEstMf8e//KroShILdohLoTJQFOiHaP2SgCrDbgE=----ATTACHMENT:----NTYyNjIwODc5NzgyNDU4NyAyNDEzOTA0OTIxNjIyMzIwIDUzODg3MTQ0OTM0ODU0OTc=