-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[DI][autowiring] throw exception when many services use the same class. #16642
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
aitboudad
commented
Nov 23, 2015
Q | A |
---|---|
Bug fix? | yes |
New feature? | no |
BC breaks? | no |
Deprecations? | no |
Fixed tickets | #16639 |
Tests pass? | yes |
License | MIT |
@dunglas can you help review this. I can't quite follow the logic, but it might be late :) |
👍 looks good to me but it's late so I can be wrong :-) |
if (isset($this->types[$typeHint->name])) { | ||
$value = new Reference($this->types[$typeHint->name]); | ||
} elseif (isset($this->serviceTypes[$typeHint->name]) && isset($this->notGuessableTypes[$typeHint->name])) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this isset($this->notGuessableTypes[$typeHint->name]))
and not the opposite !isset($this->notGuessableTypes[$typeHint->name]))
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I slightly simplified the code now, if the type is in notGuessableTypes we should throw an exception.
1b73bc6
to
fb3bc6e
Compare
fb3bc6e
to
a21a016
Compare
@dunglas can you look at this in more detail? It's a really simple patch right now (@aitboudad reworked it), but it won't get merged until/unless we can give it a for-sure ok. |
👍 nice work @aitboudad! |
Thank you @aitboudad. |
…e same class. (aitboudad) This PR was merged into the 2.8 branch. Discussion ---------- [DI][autowiring] throw exception when many services use the same class. | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Fixed tickets | #16639 | Tests pass? | yes | License | MIT Commits ------- a21a016 [DI][autowiring] throw exception when many services use the same class.