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

PHPStan not correctly resolving available services in subclassed AbstractController::getSubscribedServices()

Open theplankmeister opened this issue 6 years ago • 1 comments

Summary of a problem or a feature request

It appears that PHPStan doesn't analyse correctly the inheritance in Symfony controllers' getSubscribedServices method in subclasses of the abstract controller.

Code snippet that reproduces the problem

https://github.com/theplankmeister/phpstanerr/blob/master/src/Controller/DefaultController.php#L17 also see https://github.com/theplankmeister/phpstanerr/blob/master/src/Example/ExampleService.php and the output of https://travis-ci.com/theplankmeister/phpstanerr/jobs/166870630 which demonstrates that the service DOES exist (via Cypress testing defined in https://github.com/theplankmeister/phpstanerr/blob/master/cypress/integration/whatevs.js) yet PHPStan still fails.

Expected output

Expected PHPStan to not complain about Service "example_service" is not registered in the container.

theplankmeister avatar Dec 22 '18 21:12 theplankmeister

Any updates on this? I've just activated phpstan-symfony and stumbled right upon this issue.

althaus avatar Sep 30 '20 15:09 althaus