KuleuvenAuthenticationBundle   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 6

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 6
dl 0
loc 17
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A build() 0 14 1
1
<?php
2
3
namespace Kuleuven\AuthenticationBundle;
4
5
use Kuleuven\AuthenticationBundle\Compiler\AuthenticationAttributesProviderPass;
6
use Kuleuven\AuthenticationBundle\Compiler\KuleuvenShibbolethAttributeDefinitionsXmlParserPass;
7
use Kuleuven\AuthenticationBundle\Security\ShibbolethAuthenticationListenerFactory;
8
use Symfony\Bundle\SecurityBundle\DependencyInjection\SecurityExtension;
9
use Symfony\Component\HttpKernel\Bundle\Bundle;
10
use Symfony\Component\DependencyInjection\ContainerBuilder;
11
12
class KuleuvenAuthenticationBundle extends Bundle
13
{
14
    public function build(ContainerBuilder $container)
15
    {
16
        parent::build($container);
17
18
        $bundleDirectory = dirname((new \ReflectionClass(get_class($this)))->getFileName());
19
        $xmlPath = $bundleDirectory . '/Resources/xml/attribute-map.xml';
20
        $container->addCompilerPass(new KuleuvenShibbolethAttributeDefinitionsXmlParserPass($xmlPath));
21
        $container->addCompilerPass(new AuthenticationAttributesProviderPass());
22
23
24
        /** @var SecurityExtension $extension */
25
        $extension = $container->getExtension('security');
26
        $extension->addSecurityListenerFactory(new ShibbolethAuthenticationListenerFactory());
27
    }
28
}
29