This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/src/Symfony/Component
Fabien Potencier 219b050d30 bug #18766 Make failed autowiring error messages more explicit (lemoinem)
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
-------

6894e03 Make failed autowiring error messages more explicit
2016-05-13 12:58:08 -05:00
..
Asset Merge branch '3.0' 2016-03-10 12:16:56 +01:00
BrowserKit Merge branch '3.0' 2016-03-04 08:56:56 +01:00
Cache feature #18715 [FrameworkBundle] Default to Apcu+Filesystem cache chain (nicolas-grekas) 2016-05-13 12:53:26 -05:00
ClassLoader Merge branch '3.0' 2016-03-30 12:41:47 +02:00
Config Merge branch '3.0' 2016-04-20 20:54:21 +02:00
Console move event listener method type hint docs to @Event annotations default value. makes it easily parsable by PhpStorm plugin 2016-05-03 20:48:46 +02:00
CssSelector Merge branch '3.0' 2016-03-04 08:56:56 +01:00
Debug Merge branch '3.0' 2016-05-12 10:59:27 -05:00
DependencyInjection Make failed autowiring error messages more explicit 2016-05-12 14:18:46 -04:00
DomCrawler feature #18184 [DomCrawler] Expose getter for uri (hason) 2016-05-13 10:49:09 -05:00
EventDispatcher [EventDispatcher] fix tests 2016-05-05 08:56:13 +02:00
ExpressionLanguage Merge branch '3.0' 2016-03-10 12:16:56 +01:00
Filesystem Merge branch '3.0' 2016-04-12 20:27:47 +02:00
Finder Merge branch '3.0' 2016-03-10 12:16:56 +01:00
Form move event listener method type hint docs to @Event annotations default value. makes it easily parsable by PhpStorm plugin 2016-05-03 20:48:46 +02:00
HttpFoundation Merge branch '3.0' 2016-04-12 20:27:47 +02:00
HttpKernel feature #18676 [HttpKernel] Add request method to logger messages (gnat42) 2016-05-13 10:12:29 -05:00
Inflector Add Inflector component (from StringUtil of PropertyAccess) 2016-03-31 15:36:48 +08:00
Intl Merge branch '3.0' 2016-04-01 10:39:52 +02:00
Ldap Merge branch '2.8' into 3.0 2016-04-14 17:30:28 +02:00
OptionsResolver Merge branch '3.0' 2016-05-12 10:59:27 -05:00
Process Merge branch '2.8' into 3.0 2016-04-14 17:30:28 +02:00
PropertyAccess Merge branch '3.0' 2016-04-20 20:54:21 +02:00
PropertyInfo Merge branch '3.0' 2016-05-03 14:24:23 +02:00
Routing Merge branch '3.0' 2016-05-03 14:24:23 +02:00
Security Merge branch '3.0' 2016-05-12 10:59:27 -05:00
Serializer [Serializer] Improve a deprecation message 2016-04-25 19:26:34 +02:00
Stopwatch Merge branch '3.0' 2016-03-04 08:56:56 +01:00
Templating Merge branch '3.0' 2016-03-27 18:15:51 +02:00
Translation [Translation] XLIFF Add uid=501(fabien) gid=20(staff) groups=20(staff),401(com.apple.sharepoint.group.1),12(everyone),61(localaccounts),79(_appserverusr),80(admin),81(_appserveradm),98(_lpadmin),33(_appstore),100(_lpoperator),204(_developer),395(com.apple.access_ftp),398(com.apple.access_screensharing),399(com.apple.access_ssh) to meta data. 2016-05-12 13:19:29 -05:00
Validator Merge branch '3.0' 2016-04-20 13:42:08 +02:00
VarDumper Merge branch '3.0' 2016-04-25 13:21:08 +02:00
Yaml feature #18294 [Yaml] dump non UTF-8 encoded strings as binary data (xabbuh) 2016-03-30 16:44:34 +02:00