| Conditions | 5 |
| Paths | 12 |
| Total Lines | 25 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 24 | public function load(array $configs, ContainerBuilder $container): void |
||
| 25 | { |
||
| 26 | $xmlLoader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config')); |
||
| 27 | $xmlLoader->load('enum.xml'); |
||
| 28 | |||
| 29 | $requiresForm = interface_exists(FormInterface::class); |
||
| 30 | $requiresValidator = interface_exists(ValidatorInterface::class); |
||
| 31 | $requiresTwig = class_exists(TwigBundle::class); |
||
| 32 | |||
| 33 | if ($requiresForm) { |
||
| 34 | $xmlLoader->load('form.xml'); |
||
| 35 | if (!$requiresValidator) { |
||
| 36 | $container->removeDefinition('form_extention.type_guesser.enum'); |
||
| 37 | } |
||
| 38 | } |
||
| 39 | if ($requiresValidator) { |
||
| 40 | $xmlLoader->load('validator.xml'); |
||
| 41 | } |
||
| 42 | if ($requiresTwig) { |
||
| 43 | $xmlLoader->load('twig.xml'); |
||
| 44 | } |
||
| 45 | |||
| 46 | $container->registerForAutoconfiguration(EnumInterface::class) |
||
| 47 | ->addTag('enum'); |
||
| 48 | } |
||
| 49 | } |
||
| 50 |