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

AuthorizationProvider::register()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 12
rs 9.4285
cc 1
eloc 6
nc 1
nop 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