Closed
Description
Q | A |
---|---|
Bug report? | no |
Feature request? | yes |
BC Break report? | no |
RFC? | no |
Symfony version | 4.x |
Currently when someone misspell service name the message suggesting proper spelling is displayed. However when someone puts a correct service name, but the case doesn't match a generic error message is displayed:
Cannot autowire service "AutowiredService": argument "$autowiredParam" of method "__construct()" references class "caseMissmatchService" but no such service exists. It cannot be auto-registered because it is from a different root namespace.
PhpStorm (I don't know about other IDEs) doesn't have case inspection enabled by default, so such error is hard to catch just by looking. I agree autocompletion should be used whenever possible, but such errors still happen for peoples using simple editors.
I suggest improving DX of the AutowirePass
to contain more detailed error message when service name is correct but case doesn't match. Class loader already behaves like that:
What do you think?