DispatchAuthentication   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A __invoke() 0 4 1
1
<?php
2
3
namespace T4web\Authentication\Listener;
4
5
use Zend\Authentication\AuthenticationService;
6
use T4web\Authentication\AuthenticationEvent;
7
8
class DispatchAuthentication
9
{
10
    /**
11
     * @var AuthenticationService
12
     */
13
    protected $authService;
14
15
    /**
16
     * @param AuthenticationService $authService
17
     */
18
    public function __construct(AuthenticationService $authService)
19
    {
20
        $this->authService = $authService;
21
    }
22
23
    public function __invoke(AuthenticationEvent $e)
24
    {
25
        $e->setResult($this->authService->authenticate($e->getAdapter()));
26
    }
27
}
28