| Conditions | 4 |
| Paths | 4 |
| Total Lines | 18 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 5 | ||
| Bugs | 2 | Features | 1 |
| 1 | <?php |
||
| 14 | public function process(ContainerBuilder $container) |
||
| 15 | { |
||
| 16 | if (!$container->hasDefinition('sylius.settings.schema_registry')) { |
||
| 17 | return; |
||
| 18 | } |
||
| 19 | |||
| 20 | $schemaRegistry = $container->getDefinition('sylius.settings.schema_registry'); |
||
| 21 | |||
| 22 | foreach ($container->findTaggedServiceIds('dos.settings_schema') as $id => $attributes) { |
||
| 23 | if (!array_key_exists('namespace', $attributes[0])) { |
||
| 24 | throw new \InvalidArgumentException(sprintf('Service "%s" must define the "namespace" attribute on "sylius.settings_schema" tags.', $id)); |
||
| 25 | } |
||
| 26 | |||
| 27 | $namespace = $attributes[0]['namespace']; |
||
| 28 | |||
| 29 | $schemaRegistry->addMethodCall('registerSchema', array($namespace, new Reference($id))); |
||
| 30 | } |
||
| 31 | } |
||
| 32 | } |
||
| 33 |