rector/src/DependencyInjection/ContainerFactory.php

25 lines
515 B
PHP

<?php declare(strict_types=1);
namespace Rector\DependencyInjection;
use Psr\Container\ContainerInterface;
final class ContainerFactory
{
public function create(): ContainerInterface
{
$appKernel = new AppKernel;
$appKernel->boot();
return $appKernel->getContainer();
}
public function createWithConfig(string $config): ContainerInterface
{
$appKernel = new AppKernel($config);
$appKernel->boot();
return $appKernel->getContainer();
}
}