File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -37,3 +37,7 @@ parameters:
3737 -
3838 message : ' #^Call to method getProperty\(\) on an unknown class PHPStan\\BetterReflection\\Reflection\\Adapter\\ReflectionEnum\.$#'
3939 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 1212use Doctrine \ORM \Mapping \Driver \AttributeDriver ;
1313use function class_exists ;
1414use function count ;
15+ use function method_exists ;
1516use const PHP_VERSION_ID ;
1617
1718class ClassMetadataFactory extends \Doctrine \ORM \Mapping \ClassMetadataFactory
@@ -47,7 +48,12 @@ protected function initialize(): void
4748 'memory ' => true ,
4849 ], $ config );
4950
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+
5157 $ this ->setEntityManager ($ em );
5258 parent ::initialize ();
5359
You can’t perform that action at this time.
0 commit comments