-
-
Notifications
You must be signed in to change notification settings - Fork 315
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
No entry or class found (for two or more definition sources) #240
Comments
Thank you for the report, I have to admit I don't know why you are getting the exception. I will try to reproduce with your example. |
OK reproduced and I think I've identified the source. I have tried a quick patch like this and it works: @@ -57,9 +57,8 @@ class ArrayDefinitionSource implements ChainableDefinitionSource
if ($definition === null) {
// Not found, we use the chain or return null
if ($this->chainedSource) {
- return $this->chainedSource->getDefinition($name, $parentDefinition);
+ $definition = $this->chainedSource->getDefinition($name, $parentDefinition);
}
- return null;
} I will write correct tests and ensure there is no regression with this fix before releasing it (will do today). Thanks a lot for reporting that! |
Thank you for your quick reply. |
No worries. I'm keeping this issue open until it is fixed to keep track of it |
…ith the same name exist in sub-source
That wasn't too long actually. I have released 4.4.7 please give it a try and let me know if all works fine for you! |
Everything works fine for me 👍. Thanks again. |
@konstantinosDMS please do not ressuscitate closed issues. Also please do not post this as an issue, this is support and should go in the chat or StackOverflow (which you already did). You don't need to spam everywhere. |
This is a very serious problem, which I do not know how to solve.
The following code can help to reproduce it:
Output:
I think this problem may be caused by this line: https://github.com/mnapoli/PHP-DI/blob/master/src/DI/Definition/Source/ArrayDefinitionSource.php#L77
The text was updated successfully, but these errors were encountered: