Completed
Push — master ( 124fed...6caa0a )
by Tomáš
12s
created

SculpinBundle   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 7

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 7
dl 0
loc 34
ccs 0
cts 24
cp 0
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A build() 0 8 1
A getServicesFile() 0 4 1
A getConfiguration() 0 4 1
A getParametersAliases() 0 9 1
1
<?php
2
3
/*
4
 * This file is a part of Sculpin.
5
 *
6
 * (c) Dragonfly Development Inc.
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 Symplify\PHP7_Sculpin;
13
14
use Symfony\Component\DependencyInjection\Compiler\PassConfig;
15
use Symplify\PHP7_Sculpin\DependencyInjection\Compiler\DataSourcePass;
16
use Symplify\PHP7_Sculpin\DependencyInjection\Compiler\DataProviderManagerPass;
17
use Symplify\PHP7_Sculpin\DependencyInjection\Compiler\CustomMimeTypesRepositoryPass;
18
use Symplify\PHP7_Sculpin\DependencyInjection\Configuration;
19
use Symfony\Component\Config\Definition\ConfigurationInterface;
20
use Symfony\Component\DependencyInjection\ContainerBuilder;
21
use Symplify\PHP7_Sculpin\DependencyInjection\Compiler\RegisterKernelListenersPass;
22
use Symplify\SimpleBundle\AbstractSimpleBundle;
23
24
final class SculpinBundle extends AbstractSimpleBundle
25
{
26
    /**
27
     * {@inheritdoc}
28
     */
29
    public function build(ContainerBuilder $containerBuilder)
30
    {
31
        $containerBuilder->addCompilerPass(new DataProviderManagerPass());
32
        $containerBuilder->addCompilerPass(new CustomMimeTypesRepositoryPass());
33
        $containerBuilder->addCompilerPass(new DataSourcePass());
34
35
        $containerBuilder->addCompilerPass(new RegisterKernelListenersPass(), PassConfig::TYPE_AFTER_REMOVING);
36
    }
37
38
    protected function getServicesFile() : string
39
    {
40
        return __DIR__.'/Resources/config/services.yml';
41
    }
42
43
    protected function getConfiguration() : ConfigurationInterface
44
    {
45
        return new Configuration();
46
    }
47
48
    protected function getParametersAliases() : array
49
    {
50
        return [
51
            'source_dir' => 'sculpin.source_dir',
52
            'output_dir' => 'sculpin.output_dir',
53
            'permalink' => 'sculpin.permalink',
54
            'raw' => 'sculpin.raw',
55
        ];
56
    }
57
}
58