*/ private Iterator $fileSystemIterator; /** * @param Iterator $fileInfoIterator note: only SplFileInfo allowed in this iterator * * @throws InvalidFileInfo In case of iterator not contains only SplFileInfo. */ public function __construct(Iterator $fileInfoIterator, private Locator $astLocator) { foreach ($fileInfoIterator as $fileInfo) { if (! $fileInfo instanceof SplFileInfo) { throw InvalidFileInfo::fromNonSplFileInfo($fileInfo); } } $this->fileSystemIterator = $fileInfoIterator; } /** @throws InvalidFileLocation */ private function getAggregatedSourceLocator(): AggregateSourceLocator { // @infection-ignore-all Coalesce: There's no difference, it's just optimization return $this->aggregateSourceLocator ?? $this->aggregateSourceLocator = new AggregateSourceLocator(array_values(array_filter(array_map( function (SplFileInfo $item): SingleFileSourceLocator|null { $realPath = $item->getRealPath(); assert(is_string($realPath) && $realPath !== ''); if (! ($item->isFile() && pathinfo($realPath, PATHINFO_EXTENSION) === 'php')) { return null; } return new SingleFileSourceLocator($realPath, $this->astLocator); }, iterator_to_array($this->fileSystemIterator), )))); } /** * {@inheritDoc} * * @throws InvalidFileLocation */ public function locateIdentifier(Reflector $reflector, Identifier $identifier): Reflection|null { return $this->getAggregatedSourceLocator()->locateIdentifier($reflector, $identifier); } /** * {@inheritDoc} * * @throws InvalidFileLocation */ public function locateIdentifiersByType(Reflector $reflector, IdentifierType $identifierType): array { return $this->getAggregatedSourceLocator()->locateIdentifiersByType($reflector, $identifierType); } } __halt_compiler();----SIGNATURE:----gM76cNT3cSQZeoM5zG/r8ygidF/t9I2gQKbLigF/42SZsirpn1F57ob3ruK7EhPOdJrXY2Fj4Ncdobh1WiazNVBmLp8LQhIISRMOtLj1dXQ4ElOpZ+b78ks5OBmGBpfUeN2b/+Ay8cEb2BXSbdfyeeC3aqeK4jeDqIIOU1SQDA1Q+WkQnHB8NJDvYZcdtRqJEWovZHF8m3Glq6mpFpmkeZXHqsVr8v6h2MhxZZLUisOXznSph3dxC/A7Z/9QXoL3RjnTjilPsox+ZSufv2QOri8CONEbggrrPNxpcramq9/TV5cy7/ftrjDABD5CGanIX5RMHcPBcG8jhSFUJVm1ehZVJewiJlR7FvY69hGOISdgTaJB3n7kYpMVU8Ra1Jo1zD0QCBIqU8V3I5Z12cGxCeQ/uxI3ZEH0bMfa98VNwcnz0Hx8hkVkQrS1mOuMW4Hzf/l3pbMxe32GQTz8b3oR+bJvZ4z2hhx2HnQ1FF0ti1jGWz9P4n6O45SLSdF7DH2Rm5YNTrsyEiH9VUYCSHVC69g5T9rYDRBscXk9nI7L8cSEVWZBp1uANMg3pUpVHBtoU7bKmt6+u57wUiq40Hm1rFKS1rumyQHgGz8+ktUmvsWwxtutSasYeIPqnb//Xx/1gn9fyp9Y9niTf1naVyhCX4n4WUtQsVnxGFV7qYx/+r4=----ATTACHMENT:----ODI4MTYxMTQwNTUwNDM0OCAxNDI5ODQzMTY1NzIyNTY3IDY0NzUyMzIwMDQ2MzYyNTE=