Having a Container::make() method would be really useful:
public function make($classname, array $parameters = []);
Any missing parameter from the array is resolved using the container.
This would probably go well with a FactoryInterace so that it can be used/injected, but while avoiding the service locator pattern (i.e. full access to all methods of the container, like get).
Having a
Container::make()method would be really useful:Any missing parameter from the array is resolved using the container.
This would probably go well with a
FactoryInteraceso that it can be used/injected, but while avoiding the service locator pattern (i.e. full access to all methods of the container, likeget).