Bug Report
| Q |
A |
| BC Break |
no |
| Version |
2.13 |
| PHP version |
7.1.27 |
composer.json content:
"require": {
...
"doctrine/dbal": "^2.13",
"doctrine/orm": "^2.13",
"symfony/cache": "^4.4",
"symfony/var-dumper": "4.4.47",
"doctrine/annotations": "^1.13",
...
},
Summary
Getting Inheritance error when trying to create entity manager:
EntityManager::create($connection, $config);
Current behavior
When I'm trying to create EntityManager instance, I get the next error:
Declaration of Doctrine\ORM\Proxy\ProxyFactory::skipClass(Doctrine\Persistence\Mapping\ClassMetadata $metadata) must be compatible with Doctrine\Common\Proxy\AbstractProxyFactory::skipClass(Doctrine\Common\Persistence\Mapping\ClassMetadata $metadata)
How to reproduce
Create \Doctrine\ORM\Configuration object instance:
$cache = new FilesystemAdapter('rest');
$entitiesPaths = ['path/to/entities'];
$config = ORMSetup::createAnnotationMetadataConfiguration($entitiesPaths, $isDevMode);
$config->setResultCache($cache);
Then creating the \Doctrine\DBAL\Connection:
$connection = DriverManager::getConnection([
'wrapperClass' => PrimaryReadReplicaConnection::class,
'driver' => 'pdo_mysql',
'keepReplica' => true,
'primary' => [
'user' => $config->get('master.username'),
'host' => $config->get('master.hostname'),
'password' => $config->get('master.password'),
'dbname' => 'db',
],
'replica' => [
[
'user' => $config->get('slave.username'),
'host' => $config->get('slave.hostname'),
'password' => $config->get('slave.password'),
'dbname' => 'db',
]
]
]
);
And to create Doctrine\ORMEntityManager instance:
$entityManager = EntityManager::create($connection, $config);
After this, error is occurred.
Expected behaviour
Doctrine\ORMEntityManager to be created.
Bug Report
composer.json content:
Summary
Getting Inheritance error when trying to create entity manager:
EntityManager::create($connection, $config);Current behavior
When I'm trying to create EntityManager instance, I get the next error:
How to reproduce
Create
\Doctrine\ORM\Configurationobject instance:Then creating the
\Doctrine\DBAL\Connection:And to create
Doctrine\ORMEntityManagerinstance:$entityManager = EntityManager::create($connection, $config);After this, error is occurred.
Expected behaviour
Doctrine\ORMEntityManagerto be created.