10000 add upgrade and changelog notes · symfony/symfony@0632c6b · GitHub
[go: up one dir, main page]

Skip to content

Commit 0632c6b

Browse files
committed
add upgrade and changelog notes
1 parent 1a649df commit 0632c6b

File tree

5 files changed

+49
-15
lines changed

5 files changed

+49
-15
lines changed

UPGRADE-4.1.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,37 @@ EventDispatcher
1515
FrameworkBundle
1616
---------------
1717

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+
path: /
31+
defaults:
32+
_controller: app.my_controller:myAction
33+
```
34+
35+
After:
36+
37+
```yml
38+
bundle_controller:
39+
path: /
40+
defaults:
41+
_controller: Symfony\Bundle\FrameworkBundle\Controller\RedirectController::redirectAction
42+
43+
service_controller:
44+
path: /
45+
defaults:
46+
_controller: app.my_controller::myAction
47+
```
48+
1849
* A `RouterInterface` that does not implement the `WarmableInterface` is deprecated and will not be supported in Symfony 5.0.
1950

2051
HttpFoundation

src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ CHANGELOG
99
* Allowed the `Router` to work with any PSR-11 container
1010
* Added option in workflow dump command to label graph with a custom label
1111
* 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.
1214

1315
4.0.0
1416
-----

src/Symfony/Component/HttpKernel/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ CHANGELOG
66

77
* added orphaned events support to `EventDataCollector`
88
* `ExceptionListener` now logs and collects exceptions at priority `2048` (previously logged at `-128` and collected at `0`)
9+
* Deprecated `service:action` syntax with a single colon to reference controllers. Use `service::method` instead.
910

1011
4.0.0
1112
-----

src/Symfony/Component/HttpKernel/Tests/Controller/ContainerControllerResolverTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -185,20 +185,20 @@ public function getUndefinedControllers()
185185
$tests = parent::getUndefinedControllers();
186186
$tests[0] = array('foo', \InvalidArgumentException::class, 'Controller "foo" does neither exist as service nor as class');
187187
$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');
188+
$tests[2] = array(array('oof', 'bar'), \InvalidArgumentException::class, 'Controller "oof" does neither exist as service nor as class');
189189
$tests[] = array(
190-
[ControllerTestService::class, 'action'],
190+
array(ControllerTestService::class, 'action'),
191191
\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?'
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?',
193193
);
194194
$tests[] = array(
195195
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?'
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?',
197197
);
198198
$tests[] = array(
199199
InvokableControllerService::class,
200200
\InvalidArgumentException::class,
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?'
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?',
202202
);
203203

204204
return $tests;

src/Symfony/Component/HttpKernel/Tests/Controller/ControllerResolverTest.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ public function testGetControllerWithStaticController($staticController, $return
123123
$resolver = $this->createControllerResolver();
124124

125125
$request = Request::create('/');
126-
$request->attributes->set('_controller', $staticController );
126+
$request->attributes->set('_controller', $staticController);
127127
$controller = $resolver->getController($request);
128128
$this->assertSame($staticController, $controller);
129129
$this->assertSame($returnValue, $controller());
@@ -133,9 +133,9 @@ public function getStaticControllers()
133133
{
134134
return array(
135135
array(AbstractController::class.'::staticAction', 'foo'),
136-
array([AbstractController::class, 'staticAction'], 'foo'),
137-
array([PrivateConstructorController::class, 'staticAction'], 'bar'),
138-
array([PrivateConstructorController::class, 'staticAction'], 'bar'),
136+
array(array(AbstractController::class, 'staticAction'), 'foo'),
137+
array(array(PrivateConstructorController::class, 'staticAction'), 'bar'),
138+
array(array(PrivateConstructorController::class, 'staticAction'), 'bar'),
139139
);
140140
}
141141

@@ -164,18 +164,18 @@ public function getUndefinedControllers()
164164
return array(
165165
array('foo', \Error::class, 'Class \'foo\' not found'),
166166
array('oof::bar', \Error::class, 'Class \'oof\' not found'),
167-
array(['oof', 'bar'], \Error::class, 'Class \'oof\' not found'),
167+
array(array('oof', 'bar'), \Error::class, 'Class \'oof\' not found'),
168168
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"?'),
169169
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'),
170170
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'),
171171
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"'),
172172
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"'),
173+
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"?'),
174+
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'),
175+
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'),
176+
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"'),
177177
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).'),
178+
array(array('a' => 'foo', 'b' => 'bar'), \InvalidArgumentException::class, 'The controller for URI "/" is not callable. Invalid array callable, expected array(controller, method).'),
179179
);
180180
}
181181

0 commit comments

Comments
 (0)
0