Completed
Push — master ( df23c1...36cd70 )
by Dominik
02:00
created

AuthorizationProvider   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 1
c 1
b 0
f 1
lcom 0
cbo 1
dl 0
loc 18
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A register() 0 12 1
1
<?php
2
3
namespace Chubbyphp\Security\Authorization;
4
5
use Pimple\Container;
6
use Pimple\ServiceProviderInterface;
7
8
final class AuthorizationProvider implements ServiceProviderInterface
9
{
10
    /**
11
     * @param Container $container
12
     */
13
    public function register(Container $container)
14
    {
15
        $container['security.authorization.key'] = '';
16
17
        $container['security.authorization.roleauthorization'] = function () {
18
            return new RoleAuthorization();
19
        };
20
21
        $container['security.authorization'] = function () use ($container) {
22
            return $container[$container['security.authorization.key']];
23
        };
24
    }
25
}
26