You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
bug symfony#10540 [HttpKernel] made parsing controllers more robust (fabpot)
This PR was merged into the 2.3 branch.
Discussion
----------
[HttpKernel] made parsing controllers more robust
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | symfony#10465
| License | MIT
| Doc PR | n/a
Under some circumstances (like passing an object without an __invoke method), the Controller resolver would lead to a PHP fatal. This PR fixes that, improved error messages, and refactored the unit tests.
Commits
-------
6dba229 made parsing controllers more robust
$this->fail('->getController() throws an \InvalidArgumentException if the _controller attribute is not well-formatted');
68
-
} catch (\Exception$e) {
69
-
$this->assertInstanceOf('\InvalidArgumentException', $e, '->getController() throws an \InvalidArgumentException if the _controller attribute is not well-formatted');
$this->fail('->getController() throws an \InvalidArgumentException if the _controller attribute contains a non-existent class');
76
-
} catch (\Exception$e) {
77
-
$this->assertInstanceOf('\InvalidArgumentException', $e, '->getController() throws an \InvalidArgumentException if the _controller attribute contains a non-existent class');
$this->fail('->getController() throws an \InvalidArgumentException if the _controller attribute contains a non-existent method');
84
-
} catch (\Exception$e) {
85
-
$this->assertInstanceOf('\InvalidArgumentException', $e, '->getController() throws an \InvalidArgumentException if the _controller attribute contains a non-existent method');
0 commit comments