CacheDriverResolver   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 3
Bugs 0 Features 2
Metric Value
wmc 2
eloc 9
c 3
b 0
f 2
dl 0
loc 18
ccs 4
cts 4
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A listens() 0 11 1
A authorizer() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
/**
6
 * @author enea dhack <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Enea\Authorization\Resolvers;
13
14
use Enea\Authorization\Drivers\Cache\Authorizer as CacheAuthorizer;
15
use Enea\Authorization\Drivers\Cache\Listeners\OperatedOnAuthorization;
16
use Enea\Authorization\Events\Denied;
17
use Enea\Authorization\Events\Granted;
18
use Enea\Authorization\Events\Revoked;
19
20
class CacheDriverResolver extends Resolver
21
{
22 101
    protected function authorizer(): string
23
    {
24 101
        return CacheAuthorizer::class;
25
    }
26
27 101
    protected function listens(): array
28
    {
29
        return [
30
            Granted::class => [
31 101
                OperatedOnAuthorization::class,
32
            ],
33
            Revoked::class => [
34
                OperatedOnAuthorization::class,
35
            ],
36
            Denied::class => [
37
                OperatedOnAuthorization::class,
38
            ],
39
        ];
40
    }
41
}
42