Skip to content

Commit

Permalink
Merge pull request #805 from weaverryan/revert-alias-removal
Browse files Browse the repository at this point in the history
Revert "Remove aliases for common interfaces"
  • Loading branch information
weaverryan committed Apr 19, 2018
2 parents b2754fd + 288a5ee commit 703fad3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions Resources/config/dbal.xml
Expand Up @@ -63,6 +63,7 @@
<argument>%doctrine.default_connection%</argument>
<argument>%doctrine.default_entity_manager%</argument>
</service>
<service id="Doctrine\Common\Persistence\ManagerRegistry" alias="doctrine" public="false" />
<service id="Symfony\Bridge\Doctrine\RegistryInterface" alias="doctrine" public="false" />

<service id="doctrine.twig.doctrine_extension" class="Doctrine\Bundle\DoctrineBundle\Twig\DoctrineExtension" public="false">
Expand Down
1 change: 1 addition & 0 deletions Resources/config/orm.xml
Expand Up @@ -75,6 +75,7 @@
</parameters>

<services>
<service id="Doctrine\Common\Persistence\ObjectManager" alias="doctrine.orm.entity_manager" public="false" />
<service id="Doctrine\ORM\EntityManagerInterface" alias="doctrine.orm.entity_manager" public="false" />

<!--- Deprecated Annotation Metadata Reader Service alias, use annotation_reader service -->
Expand Down
4 changes: 4 additions & 0 deletions Tests/DependencyInjection/DoctrineExtensionTest.php
Expand Up @@ -4,6 +4,8 @@

use Doctrine\Bundle\DoctrineBundle\DependencyInjection\DoctrineExtension;
use Doctrine\Bundle\DoctrineBundle\Tests\Builder\BundleConfigurationBuilder;
use Doctrine\Common\Persistence\ManagerRegistry;
use Doctrine\Common\Persistence\ObjectManager;
use Doctrine\Common\Proxy\AbstractProxyFactory;
use Doctrine\DBAL\Connection;
use Doctrine\DBAL\Driver\Connection as DriverConnection;
Expand All @@ -30,6 +32,8 @@ public function testAutowiringAlias()
$expectedAliases = [
DriverConnection::class => 'database_connection',
Connection::class => 'database_connection',
ManagerRegistry::class => 'doctrine',
ObjectManager::class => 'doctrine.orm.entity_manager',
EntityManagerInterface::class => 'doctrine.orm.entity_manager',
];

Expand Down

0 comments on commit 703fad3

Please sign in to comment.