phpstan-symfony icon indicating copy to clipboard operation
phpstan-symfony copied to clipboard

Feature request: Confirm if class and action method exist for Symfony controller definition

Open DAcodedBEAT opened this issue 2 years ago • 0 comments

Currently, if a controller definition refers to a non-existent class/action method an error would be raised at time of route invocation.

example routing definition:

example_route:
  path: /example/route
  controller: nonexistent_controller_class::indexAction

When curl'ing this route, this raises the following exception:

InvalidArgumentException
The controller for URI "/example/route" is not callable: Controller "nonexistent_controller_class" does neither exist as service nor as class.

I would like phpstan-symfony to analyze route definitions so errors like this can be caught ahead of time rather than at runtime.

DAcodedBEAT avatar Jun 29 '22 15:06 DAcodedBEAT