Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[DependencyInjection] Improved the validation of the service names for XML files#18855
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Added a regex constraint for the service id in the xsd
stof commentedMay 24, 2016
what is the reasonning for this regex ? Btw, I'm quite sure this forbids some values which are accepted today. |
javiereguiluz commentedMay 24, 2016
@marcoalbarelli improving the XML validation is always a good thing, but I'd like to ask you to please provide a link to the code that restricts the service names to have these chars. I remember a recent discussion (https://github.com/symfony/symfony/pull/18028/files) where we tried to restrict the list of allowed characters but at the end we decided to not change anything. |
marcoalbarelli commentedMay 24, 2016
@stof the idea behind this is to enforce the service id naming convention at the xsd level. |
stof commentedMay 24, 2016
#18028 was deprecating some chars which prevented dumping the container to an optimized PHP file (and so making such ids unusable in the context of the fullstack framework which performs such dumping). And we indeed removed such limitation in the dumper. In Symfony 3.1+, any PHP string is allowed as service id (including weird ids, like the empty string or emojis) |
marcoalbarelli commentedMay 24, 2016
@javiereguiluz I proposed this PR because it would be very convenient to have IDE perform the validation of service ids on its own. I can expand on this but it's quite a long story :) |
stof commentedMay 24, 2016
@marcoalbarelli XML performing a broken validation is way worse than the current state, as it breaks existing projects. |
marcoalbarelli commentedMay 24, 2016 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@stof define broken :) |
stof commentedMay 24, 2016
@marcoalbarelli a convention for the naming does not mean that using something else is forbidden. It just means that it is recommended to use such naming. Projects are free to use something else than the recommended naming convention even in 2.x versions (as long as they stick to chars compatible with the PhpDumper or avoid dumping their container). |
marcoalbarelli commentedMay 24, 2016
In any case I think#18167 makes this PR useless if not harmful |
Added a regex constraint for the service id in the xsd