Conditions | 3 |
Paths | 4 |
Total Lines | 19 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 12 |
Changes | 0 |
1 | <?php |
||
13 | public function load(array $configs, ContainerBuilder $container) |
||
14 | { |
||
15 | $configuration = new Configuration(); |
||
16 | $config = $this->processConfiguration($configuration, $configs); |
||
17 | |||
18 | $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config')); |
||
19 | $loader->load('services.yml'); |
||
20 | |||
21 | $definition = $container->findDefinition('crossknowledge.device_detect'); |
||
22 | if (!empty($config['cache_manager'])) { |
||
23 | $definition->replaceArgument(1, new Reference($config['cache_manager'])); |
||
24 | } |
||
25 | |||
26 | if (!empty($config['device_detector_options'])) { |
||
27 | $definition->addArgument($config['device_detector_options']); |
||
28 | } else { |
||
29 | $definition->addArgument(null); |
||
30 | } |
||
31 | } |
||
32 | } |
||
33 |