Open mxr576 opened 2 years ago
This could be very hard. Just like entity query access.
Is it? Don't we just need to analyze implementation of \Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface::process()
and identify if they added any new service definition without marking it public? (Just thinking aloud)
Well, I think we actually need to listen to calls of setDefinition
and check the arguments. And even then, we may not have enough information. We may need to leverage dynamic return type extensions like the entity query work, where we modify what the type is considered internally to PHPStan.
https://www.drupal.org/node/3194517
Captured this in Behat tests:
I guess this in a runtime deprecation warning that cannot be checked by PHPStan deprecations, therefore we need a custom rule for that.