Conditions | 3 |
Paths | 8 |
Total Lines | 19 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
28 | public function process(ContainerBuilder $container) |
||
29 | { |
||
30 | $definition = $container->findDefinition('sylius.theme.repository'); |
||
31 | |||
32 | $loader = $container->get('sylius.theme.loader'); |
||
33 | |||
34 | $serializedThemes = []; |
||
35 | try { |
||
36 | $themeFiles = $container->get('sylius.theme.locator')->locate('theme.json', null, false); |
||
37 | foreach ($themeFiles as $themeFile) { |
||
38 | $serializedThemes[] = serialize($loader->load($themeFile)); |
||
39 | $container->addResource(new FileResource($themeFile)); |
||
40 | } |
||
41 | |||
42 | $definition->addArgument($serializedThemes); |
||
43 | } catch (\InvalidArgumentException $e) { |
||
44 | // No files found. |
||
45 | } |
||
46 | } |
||
47 | } |
||
48 |