lazy-container
lazy-container copied to clipboard
Support lazy-loading of internal dependencies
This might be a really hard one to solve, but the idea is simple: lazy services are not necessarily the front-facing services inside your app.
Let's say you have a class:
class MyService
{
public function __construct(SomethingSlow $iWantThisToBeLazy) {}
}
This kind of container currently only allows MyService to be fetched lazily, but doesn't allow the internal dependency to SomethingSlow to be replaced with a lazy instance.
This problem may not be solvable by the lib as-is, but it is a good scope for research, and it may spawn into further development of the container-interop standard.
👍 I will write test for that