Skip to content

Commit 4193c2a

Browse files
Add try catch
1 parent 6da1a65 commit 4193c2a

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/Stubs/Doctrine/StubFilesExtensionLoader.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,13 @@ public function getFiles(): array
6161
$files[] = $stubsDir . '/ServiceEntityRepository.stub';
6262
}
6363

64-
$collectionVersion = class_exists(InstalledVersions::class)
65-
? InstalledVersions::getVersion('doctrine/collections')
66-
: null;
64+
try {
65+
$collectionVersion = class_exists(InstalledVersions::class)
66+
? InstalledVersions::getVersion('doctrine/collections')
67+
: null;
68+
} catch (\OutOfBoundsException $e) {
69+
$collectionVersion = null;
70+
}
6771
if ($collectionVersion !== null && strpos($collectionVersion, '1.') === 0) {
6872
$files[] = $stubsDir . '/Collections/Collection1.stub';
6973
} else {

0 commit comments

Comments
 (0)