theofidry / SfContextBundle

Static access to the DIC in Symfony.
MIT License
4 stars 2 forks source link

Cannot access private services directly #4

Open Nek- opened 4 years ago

theofidry commented 4 years ago

I don't think there is much that can be done here since those service cannot be inlined unless explicitly being marked as public.

This bundle only access to the container, it does not tweak it and cannot introspect what services you requested to access in advance.

That said if someone has an idea on how to make it better I'd happy to take up on the offer

odolbeau commented 4 years ago

Maybe with a compiler pass which check that all services are public? :thinking:

theofidry commented 4 years ago

But you don't know in advance (at compilation time) what service are being used unless analysing the code somehow right?