Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
[DependencyInjection] Bind with type is broken if no typehint used for constructor parameter #34223
nicolas-grekas left a comment
Here is a code review, but before fixing it: this will break configurations that target different arguments when the type is here or not. To them, the exception will be a false positive.
A safer approach might be to improve the message where the current exception is thrown. Because we might have less context there, the message might be more generic - but that's the point of not triggering false positives and still giving some hint.
I guess it shouldn't break, because exception will trigger only if we have different argument type in binding and in constructor. But I also don’t like throwing an exception in this place I can suggest to add error message. It will look like this http://joxi.net/YmEyjBYtw5O7Bm