-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[DI] Handle root namespace in service definitions #23468
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
return '\\'.substr(str_replace('\\\\', '\\', $class), 1, -1); | ||
$class = substr(str_replace('\\\\', '\\', $class), 1, -1); | ||
|
||
return '\\' === substr($class, 0, 1) ? $class : '\\'.$class; |
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.
0 === strpos($class, '\\')
Sorry, something went wrong.
All reactions
Thank you @ro0NL. |
All reactions
Sorry, something went wrong.
This PR was squashed before being merged into the 2.7 branch (closes #23468). Discussion ---------- [DI] Handle root namespace in service definitions | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #... <!-- #-prefixed issue number(s), if any --> | License | MIT | Doc PR | symfony/symfony-docs#... <!--highly recommended for new features--> Fixes ``` Cannot dump definition because of invalid class name ('\\stdClass') ``` for ```yaml services: foo: {class: '\stdClass' } ``` `ContainerBuilder` allows it, so `PhpDumper` should as well. Commits ------- 05170c8 [DI] Handle root namespace in service definitions
stloyd
fabpot
nicolas-grekas
Successfully merging this pull request may close these issues.
Fixes
for
ContainerBuilder
allows it, soPhpDumper
should as well.