Completed
Pull Request — master (#12)
by Tomáš
06:06 queued 03:15
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\GeneratorManagerPass;
18
use Symplify\PHP7_Sculpin\DependencyInjection\Compiler\CustomMimeTypesRepositoryPass;
19
use Symplify\PHP7_Sculpin\DependencyInjection\Configuration;
20
use Symfony\Component\Config\Definition\ConfigurationInterface;
21
use Symfony\Component\DependencyInjection\ContainerBuilder;
22
use Symplify\PHP7_Sculpin\DependencyInjection\Compiler\RegisterKernelListenersPass;
23
use Symplify\SimpleBundle\AbstractSimpleBundle;
24
25
final class SculpinBundle extends AbstractSimpleBundle
26
{
27
    /**
28
     * {@inheritdoc}
29
     */
30
    public function build(ContainerBuilder $containerBuilder)
31
    {
32
        $containerBuilder->addCompilerPass(new DataProviderManagerPass());
33
        $containerBuilder->addCompilerPass(new CustomMimeTypesRepositoryPass());
34
        $containerBuilder->addCompilerPass(new DataSourcePass());
35
36
        $containerBuilder->addCompilerPass(new RegisterKernelListenersPass(), PassConfig::TYPE_AFTER_REMOVING);
37
    }
38
39
    protected function getServicesFile() : string
40
    {
41
        return __DIR__.'/Resources/config/services.yml';
42
    }
43
44
    protected function getConfiguration() : ConfigurationInterface
45
    {
46
        return new Configuration();
47
    }
48
49
    protected function getParametersAliases() : array
50
    {
51
        return [
52
            'source_dir' => 'sculpin.source_dir',
53
            'output_dir' => 'sculpin.output_dir',
54
            'permalink' => 'sculpin.permalink',
55
            'raw' => 'sculpin.raw',
56
        ];
57
    }
58
}
59