File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 33namespace PHPStan \Stubs \Doctrine ;
44
55use Composer \InstalledVersions ;
6+ use OutOfBoundsException ;
67use PHPStan \BetterReflection \Reflector \Exception \IdentifierNotFound ;
78use PHPStan \BetterReflection \Reflector \Reflector ;
89use PHPStan \PhpDoc \StubFilesExtension ;
10+ use function class_exists ;
911use function dirname ;
1012use function strpos ;
1113
@@ -61,9 +63,13 @@ public function getFiles(): array
6163 $ files [] = $ stubsDir . '/ServiceEntityRepository.stub ' ;
6264 }
6365
64- $ collectionVersion = class_exists (InstalledVersions::class)
65- ? InstalledVersions::getVersion ('doctrine/collections ' )
66- : null ;
66+ try {
67+ $ collectionVersion = class_exists (InstalledVersions::class)
68+ ? InstalledVersions::getVersion ('doctrine/collections ' )
69+ : null ;
70+ } catch (OutOfBoundsException $ e ) {
71+ $ collectionVersion = null ;
72+ }
6773 if ($ collectionVersion !== null && strpos ($ collectionVersion , '1. ' ) === 0 ) {
6874 $ files [] = $ stubsDir . '/Collections/Collection1.stub ' ;
6975 } else {
You can’t perform that action at this time.
0 commit comments