You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create a service where name contains "-" and there will be a syntax error.
I think the root of the problem is that PhpDumper uses Container::camelize to generate function names which doesn't comply with PHP labels.
In my opinion, PhpDumper should use an internal function to generate PHP label-safe identifiers from service names, it would be more general solution than restrict service names.
If you agree i would like to push this change.
The text was updated successfully, but these errors were encountered:
This PR was merged into the 2.2 branch.
Discussion
----------
[DependencyInjection] Add exception for service name not dumpable in PHP
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #8485#8030
| License | MIT
| Doc PR | n/a
Throws an exception when the DIC is dumped to PHP, before generating invalid PHP.
The regex comes from the PHP doc: http://www.php.net/manual/en/language.oop5.basic.php
Commits
-------
242b318 [DependencyInjection] Add exception for service name not dumpable in PHP
This PR was merged into the 2.3 branch.
Discussion
----------
[DependencyInjection][2.3] Add exception for service name not dumpable in PHP
Same as #8494 for branch 2.3 since the DI component has been refactored (bb797ee, f1c2ab7)
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #8485#8030
| License | MIT
| Doc PR | n/a
Throws an exception when the DIC is dumped to PHP, before generating invalid PHP.
The regex comes from the PHP doc: http://www.php.net/manual/en/language.oop5.basic.php
Commits
-------
9ac3556 [DependencyInjection] Add exception for service name not dumpable in PHP
Create a service where name contains "-" and there will be a syntax error.
I think the root of the problem is that PhpDumper uses Container::camelize to generate function names which doesn't comply with PHP labels.
In my opinion, PhpDumper should use an internal function to generate PHP label-safe identifiers from service names, it would be more general solution than restrict service names.
If you agree i would like to push this change.
The text was updated successfully, but these errors were encountered: