8000 [DX] Improve exception message when AbstractController::getParameter fails by curry684 · Pull Request #27443 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
Closed
Changes from 1 commit
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
Prev Previous commit
Next Next commit
And Fabbot disagrees again with my spaces between all operators
  • Loading branch information
curry684 committed May 31, 2018
commit 90222dbc22ab15f121922aff0ea84b7d452e6af3
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ protected function getParameter(string $name)
{
if (!$this->container->has('parameter_bag')) {
throw new ServiceNotFoundException('parameter_bag', null, null, array(),
'The "parameter_bag" service could not be located. Ensure that the controller is either set ' .
'The "parameter_bag" service could not be located. Ensure that the controller is either set '.
'to be autoconfigured or wired manually to inject it.');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[...] to be autoconfigured or has the "container.service_subscriber" tag.?

should be on one single long line

Copy link
Member
@nicolas-grekas nicolas-grekas Jun 1, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sprintf('The "%s::getParameter()" method is missing a parameter bag to work properly. Did you forget to register your controller as a service subscriber? This can be fixed e.g. by using autoconfiguration or by manually wiring a "parameter_bag" in the service locator passed to the controller.', get_class($this))

(the name of the parameter is of no importance IMHO, but the controller class IS.)

}

Expand Down
0