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
In an older version of a library I use, there as a compiler pass that uses annotations to automatically tag services whose classes have it. It defines services as having the actual class, but the id attribute is an incremented integer index starting from 0. This causes the XmlFileLoader to throw an exception due to variable casting.
I know this method of creating services is obsolete, but I am wondering whether not allowing a service with id 0 (which here is anonymous and only used in a collection parameter of another service) should be prohibited. Perhaps the linked condition should strictly check for null and empty string instead of casting it to a boolean.
None of this is a big issue to me, just thought I would report it.
Additional context
I run into this issue only while performing a debug:container command, the application itself runs without an exception for some reason.
The text was updated successfully, but these errors were encountered:
…entifier (xabbuh)
This PR was merged into the 3.4 branch.
Discussion
----------
[DependencyInjection] the string "0" is a valid service identifier
| Q | A
| ------------- | ---
| Branch? | 3.4
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #29854
| License | MIT
| Doc PR |
Commits
-------
caca373 the string "0" is a valid service identifier
Uh oh!
There was an error while loading. Please reload this page.
Symfony version(s) affected: checked on 3.4.21
Description
Hello,
In an older version of a library I use, there as a compiler pass that uses annotations to automatically tag services whose classes have it. It defines services as having the actual class, but the
id
attribute is an incremented integer index starting from 0. This causes the XmlFileLoader to throw an exception due to variable casting.I know this method of creating services is obsolete, but I am wondering whether not allowing a service with id 0 (which here is anonymous and only used in a collection parameter of another service) should be prohibited. Perhaps the linked condition should strictly check for
null
and empty string instead of casting it to a boolean.None of this is a big issue to me, just thought I would report it.
Additional context
I run into this issue only while performing a
debug:container
command, the application itself runs without an exception for some reason.The text was updated successfully, but these errors were encountered: