Skip to content
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
2 changes: 1 addition & 1 deletion UPGRADE-5.4.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ FrameworkBundle

* Deprecate the `AdapterInterface` autowiring alias, use `CacheItemPoolInterface` instead
* Deprecate the public `profiler` service to private
* Deprecate `getDoctrine()` and `dispatchMessage()` in `AbstractController`, use method/constructor injection instead
* Deprecate `get()`, `has()`, `getDoctrine()`, and `dispatchMessage()` in `AbstractController`, use method/constructor injection instead

HttpKernel
----------
Expand Down
2 changes: 1 addition & 1 deletion UPGRADE-6.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ FrameworkBundle
* Remove option `--xliff-version` of the `translation:update` command, use e.g. `--output-format=xlf20` instead
* Remove option `--output-format` of the `translation:update` command, use e.g. `--output-format=xlf20` instead
* Remove the `AdapterInterface` autowiring alias, use `CacheItemPoolInterface` instead
* Remove `getDoctrine()` and `dispatchMessage()` in `AbstractController`, use method/constructor injection instead
* Remove `get()`, `has()`, `getDoctrine()`, and `dispatchMessage()` in `AbstractController`, use method/constructor injection instead

HttpFoundation
--------------
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ CHANGELOG
* Add autowiring alias for `HttpCache\StoreInterface`
* Deprecate the `AdapterInterface` autowiring alias, use `CacheItemPoolInterface` instead
* Deprecate the public `profiler` service to private
* Deprecate `getDoctrine()` and `dispatchMessage()` in `AbstractController`, use method/constructor injection instead
* Deprecate `get()`, `has()`, `getDoctrine()`, and `dispatchMessage()` in `AbstractController`, use method/constructor injection instead

5.3
---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,31 +96,39 @@ public static function getSubscribedServices()
'session' => '?'.SessionInterface::class,
'security.authorization_checker' => '?'.AuthorizationCheckerInterface::class,
'twig' => '?'.Environment::class,
'doctrine' => '?'.ManagerRegistry::class,
'doctrine' => '?'.ManagerRegistry::class, // to be removed in 6.0
'form.factory' => '?'.FormFactoryInterface::class,
'security.token_storage' => '?'.TokenStorageInterface::class,
'security.csrf.token_manager' => '?'.CsrfTokenManagerInterface::class,
'parameter_bag' => '?'.ContainerBagInterface::class,
'message_bus' => '?'.MessageBusInterface::class,
'messenger.default_bus' => '?'.MessageBusInterface::class,
'message_bus' => '?'.MessageBusInterface::class, // to be removed in 6.0
'messenger.default_bus' => '?'.MessageBusInterface::class, // to be removed in 6.0
];
}

/**
* Returns true if the service id is defined.
*
* @deprecated since 5.4, use method or constructor injection in your controller instead
*/
protected function has(string $id): bool
{
trigger_deprecation('symfony/framework-bundle', '5.4', 'Method "%s()" is deprecated, use method or constructor injection in your controller instead.', __METHOD__);

return $this->container->has($id);
}

/**
* Gets a container service by its id.
*
* @return object The service
*
* @deprecated since 5.4, use method or constructor injection in your controller instead
*/
protected function get(string $id): object
{
trigger_deprecation('symfony/framework-bundle', '5.4', 'Method "%s()" is deprecated, use method or constructor injection in your controller instead.', __METHOD__);

return $this->container->get($id);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,9 @@ public function testCreateFormBuilder()
$this->assertEquals($formBuilder, $controller->createFormBuilder('foo'));
}

/**
* @group legacy
*/
public function testGetDoctrine()
{
$doctrine = $this->createMock(ManagerRegistry::class);
Expand Down