Bundle::getContainerExtension()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 4
nc 2
nop 0
1
<?php
2
3
namespace Knp\RadBundle\AppBundle;
4
5
use Symfony\Component\HttpKernel\Bundle\Bundle as BaseBundle;
6
use Symfony\Component\DependencyInjection\ContainerBuilder;
7
use Symfony\Component\DependencyInjection\Compiler\PassConfig;
8
use Knp\RadBundle\DependencyInjection\Compiler;
9
use Symfony\Component\Config\Definition\Builder\NodeParentInterface;
10
11
class Bundle extends BaseBundle implements ConfigurableBundleInterface
12
{
13
    public function build(ContainerBuilder $container)
14
    {
15
        $container->addCompilerPass(new Compiler\RemoveUnavailableServicesPass);
16
        $container->addCompilerPass(new Compiler\RegisterAliceProvidersPass($this));
0 ignored issues
show
Unused Code introduced by
The call to RegisterAliceProvidersPass::__construct() has too many arguments starting with $this.

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
17
        $container->addCompilerPass(new Compiler\RegisterDoctrineRepositoriesPass($this));
18
        $container->addCompilerPass(new Compiler\RegisterFormCreatorsPass);
19
        $container->addCompilerPass(new Compiler\RegisterTwigExtensionsPass($this));
20
        $container->addCompilerPass(new Compiler\RegisterSecurityVotersPass($this));
21
        $container->addCompilerPass(new Compiler\RegisterAppBundlePass($this));
22
        $container->addCompilerPass(new Compiler\RegisterFormTypesPass($this));
23
        $container->addCompilerPass(new Compiler\RegisterFormTypeExtensionsPass($this));
24
        $container->addCompilerPass(new Compiler\RegisterValidatorConstraintsPass($this));
25
        $container->addCompilerPass(new Compiler\RegisterFormCreatorsPass);
26
    }
27
28
    public function getContainerExtension()
29
    {
30
        if ($extension = parent::getContainerExtension()) {
31
            return $extension;
32
        }
33
34
        return $this->extension = new ContainerExtension($this);
35
    }
36
37
    public function buildConfiguration(NodeParentInterface $rootNode)
38
    {
39
    }
40
41
    public function buildContainer(array $config, ContainerBuilder $container)
42
    {
43
    }
44
}
45