Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow doctrine/persistence 2.x #1181

Merged
merged 2 commits into from
Aug 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions DependencyInjection/Compiler/DoctrineOrmMappingsPass.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function __construct($driver, array $namespaces, array $managerParameters
*/
public static function createXmlMappingDriver(array $namespaces, array $managerParameters = [], $enabledParameter = false, array $aliasMap = [])
{
$locator = new Definition('Doctrine\Common\Persistence\Mapping\Driver\SymfonyFileLocator', [$namespaces, '.orm.xml']);
$locator = new Definition('Doctrine\Persistence\Mapping\Driver\SymfonyFileLocator', [$namespaces, '.orm.xml']);
$driver = new Definition('Doctrine\ORM\Mapping\Driver\XmlDriver', [$locator]);

return new DoctrineOrmMappingsPass($driver, $namespaces, $managerParameters, $enabledParameter, $aliasMap);
Expand All @@ -80,7 +80,7 @@ public static function createXmlMappingDriver(array $namespaces, array $managerP
*/
public static function createYamlMappingDriver(array $namespaces, array $managerParameters = [], $enabledParameter = false, array $aliasMap = [])
{
$locator = new Definition('Doctrine\Common\Persistence\Mapping\Driver\SymfonyFileLocator', [$namespaces, '.orm.yml']);
$locator = new Definition('Doctrine\Persistence\Mapping\Driver\SymfonyFileLocator', [$namespaces, '.orm.yml']);
$driver = new Definition('Doctrine\ORM\Mapping\Driver\YamlDriver', [$locator]);

return new DoctrineOrmMappingsPass($driver, $namespaces, $managerParameters, $enabledParameter, $aliasMap);
Expand All @@ -101,8 +101,8 @@ public static function createYamlMappingDriver(array $namespaces, array $manager
*/
public static function createPhpMappingDriver(array $namespaces, array $managerParameters = [], $enabledParameter = false, array $aliasMap = [])
{
$locator = new Definition('Doctrine\Common\Persistence\Mapping\Driver\SymfonyFileLocator', [$namespaces, '.php']);
$driver = new Definition('Doctrine\Common\Persistence\Mapping\Driver\PHPDriver', [$locator]);
$locator = new Definition('Doctrine\Persistence\Mapping\Driver\SymfonyFileLocator', [$namespaces, '.php']);
$driver = new Definition('Doctrine\Persistence\Mapping\Driver\PHPDriver', [$locator]);

return new DoctrineOrmMappingsPass($driver, $namespaces, $managerParameters, $enabledParameter, $aliasMap);
}
Expand Down Expand Up @@ -145,7 +145,7 @@ public static function createAnnotationMappingDriver(array $namespaces, array $d
*/
public static function createStaticPhpMappingDriver(array $namespaces, array $directories, array $managerParameters = [], $enabledParameter = false, array $aliasMap = [])
{
$driver = new Definition('Doctrine\Common\Persistence\Mapping\Driver\StaticPHPDriver', [$directories]);
$driver = new Definition('Doctrine\Persistence\Mapping\Driver\StaticPHPDriver', [$directories]);

return new DoctrineOrmMappingsPass($driver, $namespaces, $managerParameters, $enabledParameter, $aliasMap);
}
Expand Down
1 change: 0 additions & 1 deletion DependencyInjection/DoctrineExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -883,7 +883,6 @@ private function createPoolCacheDefinition(ContainerBuilder $container, string $

$definition = $container->register($serviceId, DoctrineProvider::class);
$definition->addArgument(new Reference($poolName));
$definition->setPrivate(true);

return $serviceId;
}
Expand Down
1 change: 0 additions & 1 deletion Resources/config/dbal.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@
<tag name="kernel.reset" method="reset" />
</service>
<service id="Doctrine\Persistence\ManagerRegistry" alias="doctrine" public="false" />
<service id="Doctrine\Common\Persistence\ManagerRegistry" alias="doctrine" public="false" />

<service id="doctrine.twig.doctrine_extension" class="Doctrine\Bundle\DoctrineBundle\Twig\DoctrineExtension" public="false">
<tag name="twig.extension" />
Expand Down
2 changes: 1 addition & 1 deletion Tests/DataCollector/DoctrineDataCollectorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function testCollectEntities() : void

$manager = $this->getMockBuilder('Doctrine\ORM\EntityManager')->disableOriginalConstructor()->getMock();
$config = $this->getMockBuilder('Doctrine\ORM\Configuration')->getMock();
$factory = $this->getMockBuilder('Doctrine\Common\Persistence\Mapping\AbstractClassMetadataFactory')
$factory = $this->getMockBuilder('Doctrine\Persistence\Mapping\AbstractClassMetadataFactory')
->setMethods(['getLoadedMetadata'])->getMockForAbstractClass();
$collector = $this->createCollector(['default' => $manager]);

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"require": {
"php": "^7.1 || ^8.0",
"doctrine/dbal": "^2.9.0|^3.0",
"doctrine/persistence": "^1.3.3",
"doctrine/persistence": "^1.3.3|^2.0",
"doctrine/sql-formatter": "^1.0.1",
"symfony/cache": "^4.3.3|^5.0",
"symfony/config": "^4.3.3|^5.0",
Expand Down