-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
Description
| Q | A |
|---|---|
| Bug report? | yes |
| Feature request? | no |
| BC Break report? | no |
| RFC? | no |
| Symfony version | 3.4 |
Just a minor thing: in 4.0 (or 3.4 with strict mode on), we removed the "service auto-registration" functionality of autowiring (i.e. where autowiring would automatically register a service for you if non existed for a class). But, the error message and some related code still exists:
| return ' It cannot be auto-registered because it is from a different root namespace.'; |
Unless I'm mistaken, this stuff should be removed in 4.0: the error message should not mention anything about auto-registration :). But, it's not as simple as just removing the if statement - in practice, the final error doesn't quite make sense.
To repeat the situation:
-
Type-hint some vendor class (e.g.
MyLib\FooClientthat has a service in the container (e.g.my_lib.foo_client, but does not have an autowireable alias. -
The error will mention auto-registration. But if you simply remove the last
elseif, the final message will also not make sense: it should suggest adding an alias fromMyLib\FooClienttomy_lib.foo_client.