8000 Undeprecate the single-colon controller notation by stof · Pull Request #29218 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

Undeprecate the single-colon controller notation #29218

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

Merged
merged 1 commit into from
Nov 15, 2018
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
12 changes: 1 addition & 11 deletions UPGRADE-5.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ EventDispatcher
FrameworkBundle
---------------

* Removed support for `bundle:controller:action` and `service:action` syntaxes to reference controllers. Use `serviceOrFqcn::method`
* Removed support for `bundle:controller:action` syntax to reference controllers. Use `serviceOrFqcn::method`
instead where `serviceOrFqcn` is either the service ID when using controllers as services or the FQCN of the controller.

Before:
Expand All @@ -40,11 +40,6 @@ FrameworkBundle
path: /
defaults:
_controller: FrameworkBundle:Redirect:redirect

service_controller:
path: /
defaults:
_controller: app.my_controller:myAction
```

After:
Expand All @@ -54,11 +49,6 @@ FrameworkBundle
path: /
defaults:
_controller: Symfony\Bundle\FrameworkBundle\Controller\RedirectController::redirectAction

service_controller:
path: /
defaults:
_controller: app.my_controller::myAction
```

* Removed `Symfony\Bundle\FrameworkBundle\Controller\ControllerNameParser`.
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/HttpKernel/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ CHANGELOG

* added orphaned events support to `EventDataCollector`
* `ExceptionListener` now logs exceptions at priority `0` (previously logged at `-128`)
* Deprecated `service:action` syntax with a single colon to reference controllers. Use `service::method` instead.
* Added support for using `service::method` to reference controllers, making it consistent with other cases. It is recommended over the `service:action` syntax with a single colon, which will be deprecated in the future.
* Added the ability to profile individual argument value resolvers via the
`Symfony\Component\HttpKernel\Controller\ArgumentResolver\TraceableValueResolver`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ protected function createController($controller)
{
if (1 === substr_count($controller, ':')) {
$controller = str_replace(':', '::', $controller);
@trigger_error(sprintf('Referencing controllers with a single colon is deprecated since Symfony 4.1. Use %s instead.', $controller), E_USER_DEPRECATED);
// TODO deprecate this in 5.1
}

return parent::createController($controller);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@

class ContainerControllerResolverTest extends ControllerResolverTest
{
/**
* @group legacy
* @expectedDeprecation Referencing controllers with a single colon is deprecated since Symfony 4.1. Use foo::action instead.
*/
public function testGetControllerServiceWithSingleColon()
{
$service = new ControllerTestService('foo');
Expand Down
0