Skip to content

Commit bb81f77

Browse files
committed
Use array_values to make sure the array is a list indexed from zero
1 parent 39bbdb9 commit bb81f77

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/PhpDoc/DefaultStubFilesProvider.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use PHPStan\DependencyInjection\Container;
66
use PHPStan\Internal\ComposerHelper;
77
use function array_filter;
8+
use function array_values;
89
use function strpos;
910

1011
class DefaultStubFilesProvider implements StubFilesProvider
@@ -56,10 +57,10 @@ public function getProjectStubFiles(): array
5657
return $this->getStubFiles();
5758
}
5859

59-
return $this->cachedProjectFiles = array_filter(
60+
return $this->cachedProjectFiles = array_values(array_filter(
6061
$this->getStubFiles(),
6162
fn (string $file): bool => strpos($file, ComposerHelper::getVendorDirFromComposerConfig($this->currentWorkingDirectory, $composerConfig)) === false
62-
);
63+
));
6364
}
6465

6566
}

0 commit comments

Comments
 (0)