219b050d30
This PR was merged into the 3.1-dev branch.
Discussion
----------
Make failed autowiring error messages more explicit
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no (better DX integration)
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #18658
| License | MIT
| Doc PR | N/A
@nicolas-grekas This is a port from #18691 (which was for **2.8**).
It looks like the original PR has been already mostly implemented in **master** by @weaverryan (in #17877).
IMO, this PR is still improving two use cases:
* In case a class cannot be autowired because no service can be found AND a service cannot be registered automatically, the error message now mentions both conditions (instead of simply saying no service has been found)
* In case a class with no service attached to it can be automatically instantiated but cannot be autowired because of further problems, an exception mentioning this is now thrown instead of the lower level exception, making the situation easier to debug. (The lower level exception is still available through `getPrevious()`)
Hence, I still think this PR provides useful additional DX features and is worth to be merged.
Commits
-------
|
||
---|---|---|
.. | ||
Asset | ||
BrowserKit | ||
Cache | ||
ClassLoader | ||
Config | ||
Console | ||
CssSelector | ||
Debug | ||
DependencyInjection | ||
DomCrawler | ||
EventDispatcher | ||
ExpressionLanguage | ||
Filesystem | ||
Finder | ||
Form | ||
HttpFoundation | ||
HttpKernel | ||
Inflector | ||
Intl | ||
Ldap | ||
OptionsResolver | ||
Process | ||
PropertyAccess | ||
PropertyInfo | ||
Routing | ||
Security | ||
Serializer | ||
Stopwatch | ||
Templating | ||
Translation | ||
Validator | ||
VarDumper | ||
Yaml |