PHCoreExtension::load()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 11

Duplication

Lines 11
Ratio 100 %

Importance

Changes 0
Metric Value
dl 11
loc 11
rs 9.9
c 0
b 0
f 0
cc 1
nc 1
nop 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace PH\Bundle\CoreBundle\DependencyInjection;
6
7
use Sylius\Bundle\ResourceBundle\DependencyInjection\Extension\AbstractResourceExtension;
8
use Symfony\Component\DependencyInjection\ContainerBuilder;
9
use Symfony\Component\Config\FileLocator;
10
use Symfony\Component\DependencyInjection\Loader;
11
12
/**
13
 * This is the class that loads and manages your bundle configuration.
14
 *
15
 * @see http://symfony.com/doc/current/cookbook/bundles/extension.html
16
 */
17 View Code Duplication
final class PHCoreExtension extends AbstractResourceExtension
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
18
{
19
    /**
20
     * {@inheritdoc}
21
     */
22
    public function load(array $configs, ContainerBuilder $container)
23
    {
24
        $configuration = new Configuration();
25
        $config = $this->processConfiguration($configuration, $configs);
26
27
        $this->registerResources('ph', $config['driver'], [], $container);
28
29
        $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
30
        $loader->load('services.yml');
31
        $loader->load('listeners.yml');
32
    }
33
}
34