Completed
Push — master ( 91bd08...d24b22 )
by Tomáš
11s
created

SculpinBundle::build()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 10
ccs 0
cts 10
cp 0
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 8
nc 1
nop 1
crap 2
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\Bundle\SculpinBundle;
13
14
use Symplify\PHP7_Sculpin\Bundle\SculpinBundle\DependencyInjection\Compiler\ConverterManagerPass;
15
use Symplify\PHP7_Sculpin\Bundle\SculpinBundle\DependencyInjection\Compiler\DataSourcePass;
16
use Symplify\PHP7_Sculpin\Bundle\SculpinBundle\DependencyInjection\Compiler\DataProviderManagerPass;
17
use Symplify\PHP7_Sculpin\Bundle\SculpinBundle\DependencyInjection\Compiler\FormatterManagerPass;
18
use Symplify\PHP7_Sculpin\Bundle\SculpinBundle\DependencyInjection\Compiler\GeneratorManagerPass;
19
use Symplify\PHP7_Sculpin\Bundle\SculpinBundle\DependencyInjection\Compiler\PathConfiguratorPass;
20
use Symplify\PHP7_Sculpin\Bundle\SculpinBundle\DependencyInjection\Compiler\CustomMimeTypesRepositoryPass;
21
use Symplify\PHP7_Sculpin\Bundle\SculpinBundle\DependencyInjection\Configuration;
22
use Symfony\Component\Config\Definition\ConfigurationInterface;
23
use Symfony\Component\DependencyInjection\ContainerBuilder;
24
use Symplify\SimpleBundle\AbstractSimpleBundle;
25
26
final class SculpinBundle extends AbstractSimpleBundle
27
{
28
    /**
29
     * {@inheritdoc}
30
     */
31
    public function build(ContainerBuilder $containerBuilder)
32
    {
33
        $containerBuilder->addCompilerPass(new ConverterManagerPass());
34
        $containerBuilder->addCompilerPass(new DataProviderManagerPass());
35
        $containerBuilder->addCompilerPass(new FormatterManagerPass());
36
        $containerBuilder->addCompilerPass(new GeneratorManagerPass());
37
        $containerBuilder->addCompilerPass(new PathConfiguratorPass());
38
        $containerBuilder->addCompilerPass(new CustomMimeTypesRepositoryPass());
39
        $containerBuilder->addCompilerPass(new DataSourcePass());
40
    }
41
42
    protected function getServicesFile() : string
43
    {
44
        return __DIR__.'/Resources/config/services.yml';
45
    }
46
47
    protected function getConfiguration() : ConfigurationInterface
48
    {
49
        return new Configuration();
50
    }
51
52
    protected function getParametersAliases() : array
53
    {
54
        return [
55
            'source_dir' => 'sculpin.source_dir',
56
            'output_dir' => 'sculpin.output_dir',
57
            'permalink' => 'sculpin.permalink',
58
            'raw' => 'sculpin.raw',
59
        ];
60
    }
61
}
62