|
11 | 11 |
|
12 | 12 | namespace Symfony\Bundle\FrameworkBundle\Controller;
|
13 | 13 |
|
14 |
| -use Doctrine\Common\Persistence\ManagerRegistry as LegacyManagerRegistry; |
15 | 14 | use Doctrine\Persistence\ManagerRegistry;
|
16 | 15 | use Psr\Container\ContainerInterface;
|
17 | 16 | use Psr\Link\LinkInterface;
|
@@ -95,7 +94,7 @@ public static function getSubscribedServices()
|
95 | 94 | 'session' => '?'.SessionInterface::class,
|
96 | 95 | 'security.authorization_checker' => '?'.AuthorizationCheckerInterface::class,
|
97 | 96 | 'twig' => '?'.Environment::class,
|
98 |
| - 'doctrine' => '?'.(interface_exists(ManagerRegistry::class) ? ManagerRegistry::class : LegacyManagerRegistry::class), |
| 97 | + 'doctrine' => '?'.ManagerRegistry::class, |
99 | 98 | 'form.factory' => '?'.FormFactoryInterface::class,
|
100 | 99 | 'security.token_storage' => '?'.TokenStorageInterface::class,
|
101 | 100 | 'security.csrf.token_manager' => '?'.CsrfTokenManagerInterface::class,
|
@@ -338,11 +337,9 @@ protected function createFormBuilder($data = null, array $options = []): FormBui
|
338 | 337 | /**
|
339 | 338 | * Shortcut to return the Doctrine Registry service.
|
340 | 339 | *
|
341 |
| - * @return ManagerRegistry|LegacyManagerRegistry |
342 |
| - * |
343 | 340 | * @throws \LogicException If DoctrineBundle is not available
|
344 | 341 | */
|
345 |
| - protected function getDoctrine() |
| 342 | + protected function getDoctrine(): ManagerRegistry |
346 | 343 | {
|
347 | 344 | if (!$this->container->has('doctrine')) {
|
348 | 345 | throw new \LogicException('The DoctrineBundle is not registered in your application. Try running "composer require symfony/orm-pack".');
|
|
0 commit comments