Passed
Push — master ( e7cae8...5047e3 )
by Peter
02:30
created

AuthInitializer   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 21
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A handle() 0 3 1
A __construct() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace AbterPhp\Website\Events\Listeners;
6
7
use AbterPhp\Framework\Events\AuthReady;
8
use AbterPhp\Website\Authorization\PageCategoryProvider as AuthProvider;
9
10
class AuthInitializer
11
{
12
    /** @var AuthProvider */
13
    protected $authProvider;
14
15
    /**
16
     * AuthInitializer constructor.
17
     *
18
     * @param AuthProvider $authProvider
19
     */
20
    public function __construct(AuthProvider $authProvider)
21
    {
22
        $this->authProvider = $authProvider;
23
    }
24
25
    /**
26
     * @param AuthReady $event
27
     */
28
    public function handle(AuthReady $event)
29
    {
30
        $event->getAdapter()->registerAdapter($this->authProvider);
31
    }
32
}
33