Move creation of Dice into Container class

This commit is contained in:
Art4 2025-01-08 22:35:27 +00:00
parent 610267a3ea
commit 37ffeb8121
7 changed files with 19 additions and 33 deletions

View file

@ -21,9 +21,18 @@ use Psr\Log\LoggerInterface;
*/
class Container
{
public static function fromBasePath(string $basePath): self
{
$path = $basePath . '/static/dependencies.config.php';
$dice = (new Dice())->addRules(require($path));
return static::fromDice($dice);
}
private Dice $container;
protected function __construct(Dice $container)
private function __construct(Dice $container)
{
$this->container = $container;
}