Completed
Push — master ( f9a038...cc9983 )
by Kamil
22:34
created

TestConfigurationSourceFactory   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 3
c 1
b 0
f 1
lcom 0
cbo 4
dl 0
loc 36
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A buildConfiguration() 0 4 1
A initializeSource() 0 14 1
A getName() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of the Sylius package.
5
 *
6
 * (c) Paweł Jędrzejewski
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Sylius\Bundle\ThemeBundle\Configuration\Test;
13
14
use Sylius\Bundle\ThemeBundle\Configuration\ConfigurationSourceFactoryInterface;
15
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
16
use Symfony\Component\DependencyInjection\ContainerBuilder;
17
use Symfony\Component\DependencyInjection\Definition;
18
use Symfony\Component\DependencyInjection\Parameter;
19
use Symfony\Component\DependencyInjection\Reference;
20
21
/**
22
 * @author Kamil Kokot <[email protected]>
23
 */
24
final class TestConfigurationSourceFactory implements ConfigurationSourceFactoryInterface
25
{
26
    /**
27
     * {@inheritdoc}
28
     */
29
    public function buildConfiguration(ArrayNodeDefinition $node)
30
    {
31
        // no configuration
32
    }
33
34
    /**
35
     * {@inheritdoc}
36
     */
37
    public function initializeSource(ContainerBuilder $container, array $config)
38
    {
39
        $container->setDefinition(
40
            'sylius.theme.test_theme_configuration_manager',
41
            new Definition(TestThemeConfigurationManager::class, [
42
                new Reference('sylius.theme.configuration.processor'),
43
                new Parameter('kernel.cache_dir'),
44
            ])
45
        );
46
47
        return new Definition(TestConfigurationProvider::class, [
48
            new Reference('sylius.theme.test_theme_configuration_manager'),
49
        ]);
50
    }
51
52
    /**
53
     * {@inheritdoc}
54
     */
55
    public function getName()
56
    {
57
        return 'test';
58
    }
59
}
60