*/ 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:----G9yjpT2kvEVYNk9XiesKMvMNg1g8s7YyJmH3lmDcDndLje819zzOU6fncGshwE6Z8T74nkWi/juwghKTESNh6q8BByIzzJZWbZaHF1npydUUVVn3MsjFwmjOgCCviCvMPeCq9NXhjB58de6BeKDsf8tWi88OhVdTqS4lU7W4acqkvKBrfbUrSwdsni718RS9ZjOBGSCn23uw/bXq4Y1ZdTnIj+3bek+pCgVjGr2w+229/0z3Tt5gmR8stHBaPV77u0Du2meBj5MjjvBzkv1DFA5HPKPdh6fq6NAS8yjawE6kAe8r+KTCbfJsJmi/e9v6KFpPzFtB9uYanwPXd2NmsDL2NDaY2oI+/FUwwrNbvF4/dHG6xs7UMIa2X0ParQIvvZJV1AktV6JtMNhbVnpBYYlA+jmLuSB2IamMjaIcpfjJYHPCgTA2bDccblZyHjDT77SnDkOrYp7e/jDDe4Qd+eYb5ijAo1vRPyMzZvrSCTxya4dq+QKYW8bwYbMl0530VmbsHACxWK/rcwDawya8zdo1EXwz57Rg8r6yno/MA4pjEircXzdWOs346URyuEwb3MnnGfNl4u7AUfRK1Lnygkn6d/PHAs7zAJiLNQsjpiRMxxd8xa1dJpgMDdDFUMEgP0IP809N0fRgxIgHDTo3iVa37SmncvQccHj4OB68gws=----ATTACHMENT:----MTQ5OTIyMTgwMTY2MTU2MyAxOTczMTkxNTczOTA5MzU0IDQ2MTk3MTI5Mjc2NzM5Nzc=