Skip to content

Commit

Permalink
Merge pull request #895 from kukulich/fix
Browse files Browse the repository at this point in the history
Fixed missing assigment in `FileIteratorSourceLocator`
  • Loading branch information
Ocramius committed Dec 2, 2021
2 parents f40db61 + 9868f05 commit a314ea2
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/SourceLocator/Type/FileIteratorSourceLocator.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,17 @@ public function __construct(Iterator $fileInfoIterator, private Locator $astLoca
*/
private function getAggregatedSourceLocator(): AggregateSourceLocator
{
return $this->aggregateSourceLocator ?: new AggregateSourceLocator(array_values(array_filter(array_map(
function (SplFileInfo $item): ?SingleFileSourceLocator {
if (! ($item->isFile() && pathinfo($item->getRealPath(), PATHINFO_EXTENSION) === 'php')) {
return null;
}
return $this->aggregateSourceLocator
?? $this->aggregateSourceLocator = new AggregateSourceLocator(array_values(array_filter(array_map(
function (SplFileInfo $item): ?SingleFileSourceLocator {
if (! ($item->isFile() && pathinfo($item->getRealPath(), PATHINFO_EXTENSION) === 'php')) {
return null;
}

return new SingleFileSourceLocator($item->getRealPath(), $this->astLocator);
},
iterator_to_array($this->fileSystemIterator),
))));
return new SingleFileSourceLocator($item->getRealPath(), $this->astLocator);
},
iterator_to_array($this->fileSystemIterator),
))));
}

/**
Expand Down

0 comments on commit a314ea2

Please sign in to comment.