From 9868f05c1e32f10e3d02a5038478fb9d8c0f23e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaroslav=20Hansl=C3=ADk?= Date: Thu, 2 Dec 2021 18:35:05 +0100 Subject: [PATCH] Fixed missing assigment in FileIteratorSourceLocator --- .../Type/FileIteratorSourceLocator.php | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/SourceLocator/Type/FileIteratorSourceLocator.php b/src/SourceLocator/Type/FileIteratorSourceLocator.php index de5bc805f..75381050e 100644 --- a/src/SourceLocator/Type/FileIteratorSourceLocator.php +++ b/src/SourceLocator/Type/FileIteratorSourceLocator.php @@ -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), + )))); } /**