SensioFrameworkExtraBundlePass   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
eloc 5
dl 0
loc 13
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A process() 0 6 3
1
<?php
2
3
/*
4
 *
5
 * (c) Yaroslav Honcharuk <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace Yarhon\RouteGuardBundle\DependencyInjection\Compiler;
12
13
use Symfony\Component\DependencyInjection\ContainerBuilder;
14
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
15
use Yarhon\RouteGuardBundle\Security\TestProvider\SensioExtraProvider;
16
use Yarhon\RouteGuardBundle\Security\TestResolver\SensioExtraResolver;
17
18
/**
19
 * @author Yaroslav Honcharuk <[email protected]>
20
 */
21
class SensioFrameworkExtraBundlePass implements CompilerPassInterface
22
{
23
    /**
24
     * @see https://github.com/sensiolabs/SensioFrameworkExtraBundle/blob/v5.1.0/Resources/config/security.xml
25
     *
26
     * {@inheritdoc}
27
     */
28 21
    public function process(ContainerBuilder $container)
29
    {
30 21
        if (!$container->hasDefinition('sensio_framework_extra.security.listener') &&
31 10
            !$container->hasDefinition('framework_extra_bundle.event.is_granted')) {
32 9
            $container->removeDefinition(SensioExtraProvider::class);
33 9
            $container->removeDefinition(SensioExtraResolver::class);
34
        }
35 21
    }
36
}
37