So in theory, if you do $container->set("SomeKey", $SomeDependency);, we know that there is no point in looking in other DefinitionSources...
So yes I guess this behavior can be optimized, there are a couple of things to do:
right now, DefinitionSources are called from least priority to highest priority, so this order needs to be reversed (with all associated behavior) so that value defined in the code are searched first and reflection last.
once this is done: as soon as a Value/Closure definition is found, return it directly and ignore other definition sources (since even if they return a definition, it will be ignored anyway)
The text was updated successfully, but these errors were encountered: