MagisExtension   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 10
c 0
b 0
f 0
dl 0
loc 16
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A load() 0 13 1
1
<?php
2
3
namespace pjpawel\Magis\MagisBundle\DependencyInjection;
4
5
use pjpawel\Magis\ViewDispatcherService;
6
use Symfony\Component\Config\FileLocator;
7
use Symfony\Component\DependencyInjection\ContainerBuilder;
0 ignored issues
show
Bug introduced by
The type Symfony\Component\Depend...ection\ContainerBuilder was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
8
use Symfony\Component\DependencyInjection\Extension\Extension;
9
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
10
11
/**
12
 * @author Paweł Podgórski <[email protected]>
13
 */
14
class MagisExtension extends Extension
15
{
16
17
    public function load(array $configs, ContainerBuilder $container): void
18
    {
19
        $configDir = new FileLocator(__DIR__ . '/../../config');
20
        $loader = new YamlFileLoader($container, $configDir);
21
        $loader->load('services.yaml');
22
23
        $configuration = new Configuration();
24
        $config = $this->processConfiguration($configuration, $configs);
25
26
        $definition = $container->getDefinition(ViewDispatcherService::class);
27
        $definition->setArgument(0, $config['default_view_mode']);
28
        $definition->setArgument(1, $config['template_path']);
29
        $definition->setArgument(2, $config['services']);
30
    }
31
32
33
34
}