WellCommerceCoreBundle   C
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 28

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 28
dl 0
loc 41
rs 5
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A build() 0 10 1
B registerBundles() 0 27 2
1
<?php
2
/*
3
 * WellCommerce Open-Source E-Commerce Platform
4
 *
5
 * This file is part of the WellCommerce package.
6
 *
7
 * (c) Adam Piotrowski <[email protected]>
8
 *
9
 * For the full copyright and license information,
10
 * please view the LICENSE file that was distributed with this source code.
11
 */
12
13
namespace WellCommerce\Bundle\CoreBundle;
14
15
use Doctrine\Common\Collections\Collection;
16
use Symfony\Component\DependencyInjection\ContainerBuilder;
17
use WellCommerce\Bundle\CoreBundle\DependencyInjection\Compiler;
18
use WellCommerce\Bundle\CoreBundle\HttpKernel\AbstractWellCommerceBundle;
19
20
/**
21
 * Class WellCommerceCoreBundle
22
 *
23
 * @author  Adam Piotrowski <[email protected]>
24
 */
25
final class WellCommerceCoreBundle extends AbstractWellCommerceBundle
26
{
27
    public function build(ContainerBuilder $container)
28
    {
29
        parent::build($container);
30
        $container->addCompilerPass(new Compiler\FormDataTransformerPass());
31
        $container->addCompilerPass(new Compiler\FormResolverPass());
32
        $container->addCompilerPass(new Compiler\DataSetContextPass());
33
        $container->addCompilerPass(new Compiler\DataSetTransformerPass());
34
        $container->addCompilerPass(new Compiler\RegisterTraitGeneratorEnhancerPass());
35
        $container->addCompilerPass(new Compiler\RegisterClassMetadataEnhancerPass());
36
    }
37
    
38
    public static function registerBundles(Collection $bundles, string $environment)
39
    {
40
        $bundles->add(new \Symfony\Bundle\FrameworkBundle\FrameworkBundle());
41
        $bundles->add(new \Symfony\Bundle\SecurityBundle\SecurityBundle());
42
        $bundles->add(new \Symfony\Bundle\TwigBundle\TwigBundle());
43
        $bundles->add(new \Symfony\Bundle\MonologBundle\MonologBundle());
44
        $bundles->add(new \Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle());
45
        $bundles->add(new \Doctrine\Bundle\DoctrineBundle\DoctrineBundle());
46
        $bundles->add(new \Doctrine\Bundle\DoctrineCacheBundle\DoctrineCacheBundle());
47
        $bundles->add(new \Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle());
48
        $bundles->add(new \Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle());
49
        $bundles->add(new \Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle());
50
        $bundles->add(new \FOS\JsRoutingBundle\FOSJsRoutingBundle());
51
        $bundles->add(new \Bazinga\Bundle\JsTranslationBundle\BazingaJsTranslationBundle());
52
        $bundles->add(new \Liip\ImagineBundle\LiipImagineBundle());
53
        $bundles->add(new \Knp\DoctrineBehaviors\Bundle\DoctrineBehaviorsBundle());
54
        $bundles->add(new \Cache\AdapterBundle\CacheAdapterBundle());
55
        $bundles->add(new \EmanueleMinotto\TwigCacheBundle\TwigCacheBundle());
56
        $bundles->add(new \Knp\Bundle\SnappyBundle\KnpSnappyBundle());
57
        
58
        $bundles->add(new self());
59
        
60
        if (in_array($environment, ['dev', 'test'])) {
61
            $bundles->add(new \Symfony\Bundle\WebProfilerBundle\WebProfilerBundle());
62
            $bundles->add(new \Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle());
63
        }
64
    }
65
}
66