File tree 2 files changed +11
-1
lines changed
2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -37,3 +37,7 @@ parameters:
37
37
-
38
38
message : ' #^Call to method getProperty\(\) on an unknown class PHPStan\\BetterReflection\\Reflection\\Adapter\\ReflectionEnum\.$#'
39
39
path : src/Rules/Gedmo/PropertiesExtension.php
40
+ -
41
+ message : ' #^Call to function method_exists\(\) with ' ' Doctrine\\\\ORM\\\\EntityManager' ' and ' ' create' ' will always evaluate to true\.$#'
42
+ path : src/Doctrine/Mapping/ClassMetadataFactory.php
43
+ reportUnmatched : false
Original file line number Diff line number Diff line change 12
12
use Doctrine \ORM \Mapping \Driver \AttributeDriver ;
13
13
use function class_exists ;
14
14
use function count ;
15
+ use function method_exists ;
15
16
use const PHP_VERSION_ID ;
16
17
17
18
class ClassMetadataFactory extends \Doctrine \ORM \Mapping \ClassMetadataFactory
@@ -47,7 +48,12 @@ protected function initialize(): void
47
48
'memory ' => true ,
48
49
], $ config );
49
50
50
- $ em = EntityManager::create ($ connection , $ config );
51
+ if (!method_exists (EntityManager::class, 'create ' )) {
52
+ $ em = new EntityManager ($ connection , $ config );
53
+ } else {
54
+ $ em = EntityManager::create ($ connection , $ config );
55
+ }
56
+
51
57
$ this ->setEntityManager ($ em );
52
58
parent ::initialize ();
53
59
You can’t perform that action at this time.
0 commit comments