-
Notifications
You must be signed in to change notification settings - Fork 6
Explicitly use functions from the Configurator namespace #29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds explicit use function imports for Symfony Configurator namespace functions in the generated PHP configuration files to improve static analysis tool support.
- Adds explicit function imports for Configurator namespace functions to help static analysis tools
- Includes imports for 9 functions:
service,inline_service,service_locator,iterator,expr,abstract_arg,env,service_closure, andclosure
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
Thanks. I don't think that's in the spirit of the feature. We're in the |
XML-based service configuration has been deprecated since symfony/symfony#60568 and will no longer be supported in Symfony 8.0. See also https://symfony.com/blog/new-in-symfony-7-4-deprecated-xml-configuration. In order for ComposerRequireChecker to recognise where the functions come from, we have to import them explicitly. At the same time, PHP-CS-Fixer must not remove the import, which is actually superfluous. X-Ref GromNaN/symfony-config-xml-to-php#29, maglnet/ComposerRequireChecker#193 (comment)
XML-based service configuration has been deprecated since symfony/symfony#60568 and will no longer be supported in Symfony 8.0. See also https://symfony.com/blog/new-in-symfony-7-4-deprecated-xml-configuration. In order for ComposerRequireChecker to recognise where the functions come from, we have to import them explicitly. At the same time, PHP-CS-Fixer must not remove the import, which is actually superfluous. X-Ref GromNaN/symfony-config-xml-to-php#29, maglnet/ComposerRequireChecker#193 (comment)
XML-based service configuration has been deprecated since symfony/symfony#60568 and will no longer be supported in Symfony 8.0. See also https://symfony.com/blog/new-in-symfony-7-4-deprecated-xml-configuration. In order for ComposerRequireChecker to recognise where the functions come from, we have to import them explicitly. At the same time, PHP-CS-Fixer must not remove the import, which is actually superfluous. X-Ref GromNaN/symfony-config-xml-to-php#29, maglnet/ComposerRequireChecker#193 (comment)
|
I'm rejecting as this is not necessary nor expected. |
This adds namespace imports for functions from the
Symfony\Component\DependencyInjection\Loader\Configuratornamespace on top of the generated files.Technically, those imports are not necessary at runtime, since the functions can be resolved correctly without.
However, it makes a difference for tools like ComposerRequireChecker that have to rely purely on static analysis (SA).
With SA alone, function imports may be ambiguous (see maglnet/ComposerRequireChecker#193 (comment)).
By adding these imports, we add more static information.