SumoCodersFrameworkUserExtension   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 5

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 5
dl 0
loc 21
ccs 0
cts 11
cp 0
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A load() 0 5 1
A prepend() 0 6 1
1
<?php
2
3
namespace SumoCoders\FrameworkUserBundle\DependencyInjection;
4
5
use Symfony\Component\DependencyInjection\ContainerBuilder;
6
use Symfony\Component\Config\FileLocator;
7
use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface;
8
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
9
use Symfony\Component\DependencyInjection\Loader;
10
use Symfony\Component\Yaml\Parser;
11
12
/**
13
 * This is the class that loads and manages your bundle configuration
14
 *
15
 * To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html}
16
 */
17
class SumoCodersFrameworkUserExtension extends Extension implements PrependExtensionInterface
18
{
19
    /**
20
     * {@inheritdoc}
21
     */
22
    public function load(array $configs, ContainerBuilder $container)
23
    {
24
        $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
25
        $loader->load('services.yml');
26
    }
27
28
    /**
29
     * {@inheritdoc}
30
     */
31
    public function prepend(ContainerBuilder $container)
32
    {
33
        $yamlParser = new Parser();
34
        $config = $yamlParser->parse(file_get_contents(__DIR__ . '/../Resources/config/config.yml'));
35
        $container->prependExtensionConfig('fos_user', $config['fos_user']);
36
    }
37
}
38