di
di copied to clipboard
More self-explaining message when constructor and factory parameters are mismatching
- Is your feature request related to a problem?
I would like to propose more self-explanatory exception message for case when constructor and magic factory implementation does not match. - Explain your intentions.
I found that it is not always clear that constructor and magic fatory are bind together using parameter names, not types. Which is logical from implementation perspective (no ambiguity), however counter-intuitive from user perspective.
originally implemented in #99
Proposal
Instead of saying just

I would say Cannot implement ..\Components\HeaderFactory::create(), because parameters ($breadcrumbs, $logout) of factory method are not matching constructor of ...\Components\Breadrumbs ($breadcrumbsComponent, $logoutComponent).
If you agree with this proposal, @grifart will send PR for this.
👍
Approved by @dg. @dakur Could you please make look at this? :)
Here we go.. #284