File tree 1 file changed +8
-3
lines changed
1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 6
6
use PHPStan \BetterReflection \Reflector \Exception \IdentifierNotFound ;
7
7
use PHPStan \BetterReflection \Reflector \Reflector ;
8
8
use PHPStan \PhpDoc \StubFilesExtension ;
9
+ use function class_exists ;
9
10
use function dirname ;
10
11
use function strpos ;
11
12
@@ -61,9 +62,13 @@ public function getFiles(): array
61
62
$ files [] = $ stubsDir . '/ServiceEntityRepository.stub ' ;
62
63
}
63
64
64
- $ collectionVersion = class_exists (InstalledVersions::class)
65
- ? InstalledVersions::getVersion ('doctrine/collections ' )
66
- : null ;
65
+ try {
66
+ $ collectionVersion = class_exists (InstalledVersions::class)
67
+ ? InstalledVersions::getVersion ('doctrine/collections ' )
68
+ : null ;
69
+ } catch (\OutOfBoundsException $ e ) {
70
+ $ collectionVersion = null ;
71
+ }
67
72
if ($ collectionVersion !== null && strpos ($ collectionVersion , '1. ' ) === 0 ) {
68
73
$ files [] = $ stubsDir . '/Collections/Collection1.stub ' ;
69
74
} else {
You can’t perform that action at this time.
0 commit comments