Skip to content

Commit 60a96da

Browse files
Merge branch '4.4' into 5.0
* 4.4: Fix leftover from doctrine/persistence < 1.3 Require doctrine/persistence ^1.3
2 parents 92e992b + 8a5886c commit 60a96da

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

Controller/AbstractController.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
namespace Symfony\Bundle\FrameworkBundle\Controller;
1313

14-
use Doctrine\Common\Persistence\ManagerRegistry as LegacyManagerRegistry;
1514
use Doctrine\Persistence\ManagerRegistry;
1615
use Psr\Container\ContainerInterface;
1716
use Psr\Link\LinkInterface;
@@ -95,7 +94,7 @@ public static function getSubscribedServices()
9594
'session' => '?'.SessionInterface::class,
9695
'security.authorization_checker' => '?'.AuthorizationCheckerInterface::class,
9796
'twig' => '?'.Environment::class,
98-
'doctrine' => '?'.(interface_exists(ManagerRegistry::class) ? ManagerRegistry::class : LegacyManagerRegistry::class),
97+
'doctrine' => '?'.ManagerRegistry::class,
9998
'form.factory' => '?'.FormFactoryInterface::class,
10099
'security.token_storage' => '?'.TokenStorageInterface::class,
101100
'security.csrf.token_manager' => '?'.CsrfTokenManagerInterface::class,
@@ -338,11 +337,9 @@ protected function createFormBuilder($data = null, array $options = []): FormBui
338337
/**
339338
* Shortcut to return the Doctrine Registry service.
340339
*
341-
* @return ManagerRegistry|LegacyManagerRegistry
342-
*
343340
* @throws \LogicException If DoctrineBundle is not available
344341
*/
345-
protected function getDoctrine()
342+
protected function getDoctrine(): ManagerRegistry
346343
{
347344
if (!$this->container->has('doctrine')) {
348345
throw new \LogicException('The DoctrineBundle is not registered in your application. Try running "composer require symfony/orm-pack".');

Tests/Controller/AbstractControllerTest.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111

1212
namespace Symfony\Bundle\FrameworkBundle\Tests\Controller;
1313

14-
use Doctrine\Common\Persistence\ManagerRegistry as LegacyManagerRegistry;
15-
use Doctrine\Persistence\ManagerRegistry;
1614
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
1715
use Symfony\Bundle\FrameworkBundle\Tests\TestCase;
1816
use Symfony\Component\DependencyInjection\Container;
@@ -55,7 +53,7 @@ public function testSubscribedServices()
5553
'session' => '?Symfony\\Component\\HttpFoundation\\Session\\SessionInterface',
5654
'security.authorization_checker' => '?Symfony\\Component\\Security\\Core\\Authorization\\AuthorizationCheckerInterface',
5755
'twig' => '?Twig\\Environment',
58-
'doctrine' => '?'.(interface_exists(ManagerRegistry::class) ? ManagerRegistry::class : LegacyManagerRegistry::class),
56+
'doctrine' => '?Doctrine\\Persistence\\ManagerRegistry',
5957
'form.factory' => '?Symfony\\Component\\Form\\FormFactoryInterface',
6058
'parameter_bag' => '?Symfony\\Component\\DependencyInjection\\ParameterBag\\ContainerBagInterface',
6159
'message_bus' => '?Symfony\\Component\\Messenger\\MessageBusInterface',

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
"twig/twig": "^2.10|^3.0"
6565
},
6666
"conflict": {
67+
"doctrine/persistence": "<1.3",
6768
"phpdocumentor/reflection-docblock": "<3.0",
6869
"phpdocumentor/type-resolver": "<0.2.1",
6970
"phpunit/phpunit": "<5.4.3",

0 commit comments

Comments
 (0)