1 | <?php |
||
2 | |||
3 | namespace Zenstruck\Foundry; |
||
4 | |||
5 | use Symfony\Component\DependencyInjection\ContainerBuilder; |
||
6 | use Symfony\Component\DependencyInjection\Extension\ExtensionInterface; |
||
7 | use Symfony\Component\HttpKernel\Bundle\Bundle; |
||
8 | use Zenstruck\Foundry\Bundle\DependencyInjection\ChainManagerRegistryPass; |
||
9 | use Zenstruck\Foundry\Bundle\DependencyInjection\ZenstruckFoundryExtension; |
||
10 | |||
11 | /** |
||
12 | * Must be at src root to be auto-configured by Symfony Flex. |
||
13 | * |
||
14 | * @author Kevin Bond <[email protected]> |
||
15 | */ |
||
16 | 308 | final class ZenstruckFoundryBundle extends Bundle |
|
17 | { |
||
18 | 308 | public function boot(): void |
|
19 | 256 | { |
|
20 | if (!Factory::isBooted()) { |
||
21 | 308 | Factory::boot($this->container->get(Configuration::class)); |
|
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||
22 | } |
||
23 | 4 | } |
|
24 | |||
25 | 4 | public function build(ContainerBuilder $container): void |
|
26 | { |
||
27 | parent::build($container); |
||
28 | |||
29 | $container->addCompilerPass(new ChainManagerRegistryPass()); |
||
30 | } |
||
31 | |||
32 | protected function createContainerExtension(): ?ExtensionInterface |
||
33 | { |
||
34 | return new ZenstruckFoundryExtension(); |
||
35 | } |
||
36 | } |
||
37 |