SensioSecurityExpressionVoterPass   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A process() 0 5 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\Authorization\SensioSecurityExpressionVoter;
16
17
/**
18
 * @author Yaroslav Honcharuk <[email protected]>
19
 */
20
class SensioSecurityExpressionVoterPass implements CompilerPassInterface
21
{
22
    /**
23
     * @see https://github.com/sensiolabs/SensioFrameworkExtraBundle/blob/v5.1.0/Resources/config/security.xml
24
     *
25
     * {@inheritdoc}
26
     */
27 20
    public function process(ContainerBuilder $container)
28
    {
29 20
        if (!$container->hasDefinition('sensio_framework_extra.security.listener') ||
30 11
            !$container->hasDefinition('sensio_framework_extra.security.expression_language.default')) {
31 9
            $container->removeDefinition(SensioSecurityExpressionVoter::class);
32
        }
33 20
    }
34
}
35