8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1a649df commit 0632c6bCopy full SHA for 0632c6b
UPGRADE-4.1.md
@@ -15,6 +15,37 @@ EventDispatcher
15
FrameworkBundle
16
---------------
17
18
+ * Deprecated `bundle:controller:action` and `service:action` syntaxes to reference controllers. Use `serviceOrFqcn::method`
19
+ instead where `serviceOrFqcn` is either the service ID when using controllers as services or the FQCN of the controller.
20
+
21
+ Before:
22
23
+ ```yml
24
+ bundle_controller:
25
+ path: /
26
+ defaults:
27
+ _controller: FrameworkBundle:Redirect:redirect
28
29
+ service_controller:
30
31
32
+ _controller: app.my_controller:myAction
33
+ ```
34
35
+ After:
36
37
38
39
40
41
+ _controller: Symfony\Bundle\FrameworkBundle\Controller\RedirectController::redirectAction
42
43
44
45
46
+ _controller: app.my_controller::myAction
47
48
49
* A `RouterInterface` that does not implement the `WarmableInterface` is deprecated and will not be supported in Symfony 5.0.
50
51
HttpFoundation
src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md
@@ -9,6 +9,8 @@ CHANGELOG
9
* Allowed the `Router` to work with any PSR-11 container
10
* Added option in workflow dump command to label graph with a custom label
11
* Using a `RouterInterface` that does not implement the `WarmableInterface` is deprecated and will not be supported in Symfony 5.0.
12
+ * Deprecated `bundle:controller:action` syntax to reference controllers. Use `serviceOrFqcn::method` instead where `serviceOrFqcn`
13
+ is either the service ID or the FQCN of the controller.
14
4.0.0
-----
src/Symfony/Component/HttpKernel/CHANGELOG.md
@@ -6,6 +6,7 @@ CHANGELOG
6
7
* added orphaned events support to `EventDataCollector`
8
* `ExceptionListener` now logs and collects exceptions at priority `2048` (previously logged at `-128` and collected at `0`)
+ * Deprecated `service:action` syntax with a single colon to reference controllers. Use `service::method` instead.
src/Symfony/Component/HttpKernel/Tests/Controller/ContainerControllerResolverTest.php
@@ -185,20 +185,20 @@ public function getUndefinedControllers()
185
$tests = parent::getUndefinedControllers();
186
$tests[0] = array('foo', \InvalidArgumentException::class, 'Controller "foo" does neither exist as service nor as class');
187
$tests[1] = array('oof::bar', \InvalidArgumentException::class, 'Controller "oof" does neither exist as service nor as class');
188
- $tests[2] = array(['oof', 'bar'], \InvalidArgumentException::class, 'Controller "oof" does neither exist as service nor as class');
+ $tests[2] = array(array('oof', 'bar'), \InvalidArgumentException::class, 'Controller "oof" does neither exist as service nor as class');
189
$tests[] = array(
190
- [ControllerTestService::class, 'action'],
+ array(ControllerTestService::class, 'action'),
191
\InvalidArgumentException::class,
192
- 'Controller "Symfony\Component\HttpKernel\Tests\Controller\ControllerTestService" has required constructor arguments and does not exist in the container. Did you forget to define such a service?'
+ 'Controller "Symfony\Component\HttpKernel\Tests\Controller\ControllerTestService" has required constructor arguments and does not exist in the container. Did you forget to define such a service?',
193
);
194
195
ControllerTestService::class.'::action',
196
- \InvalidArgumentException::class, 'Controller "Symfony\Component\HttpKernel\Tests\Controller\ControllerTestService" has required constructor arguments and does not exist in the container. Did you forget to define such a service?'
+ \InvalidArgumentException::class, 'Controller "Symfony\Component\HttpKernel\Tests\Controller\ControllerTestService" has required constructor arguments and does not exist in the container. Did you forget to define such a service?',
197
198
199
InvokableControllerService::class,
200
201
- 'Controller "Symfony\Component\HttpKernel\Tests\Controller\InvokableControllerService" has required constructor arguments and does not exist in the container. Did you forget to define such a service?'
+ 'Controller "Symfony\Component\HttpKernel\Tests\Controller\InvokableControllerService" has required constructor arguments and does not exist in the container. Did you forget to define such a service?',
202
203
204
return $tests;
src/Symfony/Component/HttpKernel/Tests/Controller/ControllerResolverTest.php
@@ -123,7 +123,7 @@ public function testGetControllerWithStaticController($staticController, $return
123
$resolver = $this->createControllerResolver();
124
125
$request = Request::create('/');
126
- $request->attributes->set('_controller', $staticController );
+ $request->attributes->set('_controller', $staticController);
127
$controller = $resolver->getController($request);
128
$this->assertSame($staticController, $controller);
129
$this->assertSame($returnValue, $controller());
@@ -133,9 +133,9 @@ public function getStaticControllers()
133
{
134
return array(
135
array(AbstractController::class.'::staticAction', 'foo'),
136
- array([AbstractController::class, 'staticAction'], 'foo'),
137
- array([PrivateConstructorController::class, 'staticAction'], 'bar'),
138
+ array(array(AbstractController::class, 'staticAction'), 'foo'),
+ array(array(PrivateConstructorController::class, 'staticAction'), 'bar'),
139
140
}
141
@@ -164,18 +164,18 @@ public function getUndefinedControllers()
164
165
array('foo', \Error::class, 'Class \'foo\' not found'),
166
array('oof::bar', \Error::class, 'Class \'oof\' not found'),
167
- array(['oof', 'bar'], \Error::class, 'Class \'oof\' not found'),
+ array(array('oof', 'bar'), \Error::class, 'Class \'oof\' not found'),
168
array('Symfony\Component\HttpKernel\Tests\Controller\ControllerTest::staticsAction', \InvalidArgumentException::class, 'The controller for URI "/" is not callable. Expected method "staticsAction" on class "Symfony\Component\HttpKernel\Tests\Controller\ControllerTest", did you mean "staticAction"?'),
169
array('Symfony\Component\HttpKernel\Tests\Controller\ControllerTest::privateAction', \InvalidArgumentException::class, 'The controller for URI "/" is not callable. Method "privateAction" on class "Symfony\Component\HttpKernel\Tests\Controller\ControllerTest" should be public and non-abstract'),
170
array('Symfony\Component\HttpKernel\Tests\Controller\ControllerTest::protectedAction', \InvalidArgumentException::class, 'The controller for URI "/" is not callable. Method "protectedAction" on class "Symfony\Component\HttpKernel\Tests\Controller\ControllerTest" should be public and non-abstract'),
171
array('Symfony\Component\HttpKernel\Tests\Controller\ControllerTest::undefinedAction', \InvalidArgumentException::class, 'The controller for URI "/" is not callable. Expected method "undefinedAction" on class "Symfony\Component\HttpKernel\Tests\Controller\ControllerTest". Available methods: "publicAction", "staticAction"'),
172
array('Symfony\Component\HttpKernel\Tests\Controller\ControllerTest', \InvalidArgumentException::class, 'The controller for URI "/" is not callable. Controller class "Symfony\Component\HttpKernel\Tests\Controller\ControllerTest" cannot be called without a method name. Did you forget an "__invoke" method?'),
173
- array([$controller, 'staticsAction'], \InvalidArgumentException::class, 'The controller for URI "/" is not callable. Expected method "staticsAction" on class "Symfony\Component\HttpKernel\Tests\Controller\ControllerTest", did you mean "staticAction"?'),
174
- array([$controller, 'privateAction'], \InvalidArgumentException::class, 'The controller for URI "/" is not callable. Method "privateAction" on class "Symfony\Component\HttpKernel\Tests\Controller\ControllerTest" should be public and non-abstract'),
175
- array([$controller, 'protectedAction'], \InvalidArgumentException::class, 'The controller for URI "/" is not callable. Method "protectedAction" on class "Symfony\Component\HttpKernel\Tests\Controller\ControllerTest" should be public and non-abstract'),
176
- array([$controller, 'undefinedAction'], \InvalidArgumentException::class, 'The controller for URI "/" is not callable. Expected method "undefinedAction" on class "Symfony\Component\HttpKernel\Tests\Controller\ControllerTest". Available methods: "publicAction", "staticAction"'),
+ array(array($controller, 'staticsAction'), \InvalidArgumentException::class, 'The controller for URI "/" is not callable. Expected method "staticsAction" on class "Symfony\Component\HttpKernel\Tests\Controller\ControllerTest", did you mean "staticAction"?'),
+ array(array($controller, 'privateAction'), \InvalidArgumentException::class, 'The controller for URI "/" is not callable. Method "privateAction" on class "Symfony\Component\HttpKernel\Tests\Controller\ControllerTest" should be public and non-abstract'),
+ array(array($controller, 'protectedAction'), \InvalidArgumentException::class, 'The controller for URI "/" is not callable. Method "protectedAction" on class "Symfony\Component\HttpKernel\Tests\Controller\ControllerTest" should be public and non-abstract'),
+ array(array($controller, 'undefinedAction'), \InvalidArgumentException::class, 'The controller for URI "/" is not callable. Expected method "undefinedAction" on class "Symfony\Component\HttpKernel\Tests\Controller\ControllerTest". Available methods: "publicAction", "staticAction"'),
177
array($controller, \InvalidArgumentException::class, 'The controller for URI "/" is not callable. Controller class "Symfony\Component\HttpKernel\Tests\Controller\ControllerTest" cannot be called without a method name. Did you forget an "__invoke" method?'),
178
- array(['a' => 'foo', 'b' => 'bar'], \InvalidArgumentException::class, 'The controller for URI "/" is not callable. Invalid array callable, expected array(controller, method).'),
+ array(array('a' => 'foo', 'b' => 'bar'), \InvalidArgumentException::class, 'The controller for URI "/" is not callable. Invalid array callable, expected array(controller, method).'),
179
180
181