Support for ServiceLocator#151
Support for ServiceLocator#151ondrejmirtes merged 2 commits intophpstan:masterfrom andrey-bondar:support-service-locator
Conversation
|
Hi, what errors it resolves? Please attach a test too. |
|
@ondrejmirtes I've attached tests |
|
Thank you! |
|
Sorry for digging the old issue @ondrejmirtes but I'm implementing Symfony extension in our app and I got "Service ... is private" errors. I've found out that our app uses service locators BUT they are not extending What do you think, is it possible to change condition ( |
|
Feel free to send a PR with a test and a fix and we'll see (mostly what @lookyman will say about it :)) |
Now when private services are fetching from Psr\Container\ContainerInterface::get(), an error "Service "%s" is private" occurred.
But Symfony has ServiceLocators in order to define smaller containers with public access to services.
This PR solves error "Service "%s" is private" when service is fetching from ServiceLocator.