Conditions | 3 |
Paths | 4 |
Total Lines | 26 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
14 | public function load(array $configs, DependencyInjection\ContainerBuilder $container): void |
||
15 | { |
||
16 | $configuration = new Configuration(); |
||
17 | $config = $this->processConfiguration($configuration, $configs); |
||
18 | |||
19 | $loader = new DependencyInjection\Loader\YamlFileLoader( |
||
20 | $container, |
||
21 | new FileLocator(__DIR__ . '/../Resources/config') |
||
22 | ); |
||
23 | $loader->load('tesseract_bridge.yaml'); |
||
24 | |||
25 | $arguments = []; |
||
26 | /** @psalm-suppress MixedArrayAccess */ |
||
27 | if ($config['integrations']['cli']['enabled']) { |
||
28 | /** @psalm-suppress MixedArrayAccess */ |
||
29 | $arguments['binary_path'] = (string) $config['integrations']['cli']['path']; |
||
30 | } |
||
31 | |||
32 | /** @psalm-suppress MixedArrayAccess */ |
||
33 | if ($config['integrations']['ffi']['enabled']) { |
||
34 | /** @psalm-suppress MixedArrayAccess */ |
||
35 | $arguments['library_path'] = (string) $config['integrations']['ffi']['path']; |
||
36 | } |
||
37 | |||
38 | $definition = $container->getDefinition(Bridge\Configuration::class); |
||
39 | $definition->replaceArgument(0, $arguments); |
||
40 | } |
||
42 |