phpstan-symfony
phpstan-symfony copied to clipboard
PHPStan not correctly resolving available services in subclassed AbstractController::getSubscribedServices()
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.
Any updates on this? I've just activated phpstan-symfony and stumbled right upon this issue.