ZfcUserAuthentication   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 79
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 6
lcom 1
cbo 2
dl 0
loc 79
rs 10
c 0
b 0
f 0

6 Methods

Rating   Name   Duplication   Size   Complexity  
A hasIdentity() 0 4 1
A getIdentity() 0 4 1
A getAuthAdapter() 0 4 1
A setAuthAdapter() 0 5 1
A getAuthService() 0 4 1
A setAuthService() 0 5 1
1
<?php
2
3
namespace ZfcUser\Controller\Plugin;
4
5
use Zend\Mvc\Controller\Plugin\AbstractPlugin;
6
use Zend\Authentication\AuthenticationService;
7
use Zend\ServiceManager\ServiceLocatorInterface;
8
use ZfcUser\Authentication\Adapter\AdapterChain as AuthAdapter;
9
10
class ZfcUserAuthentication extends AbstractPlugin
11
{
12
    /**
13
     * @var AuthAdapter
14
     */
15
    protected $authAdapter;
16
17
    /**
18
     * @var AuthenticationService
19
     */
20
    protected $authService;
21
22
    /**
23
     * @var ServiceLocatorInterface
24
     */
25
    protected $serviceLocator;
26
27
    /**
28
     * Proxy convenience method
29
     *
30
     * @return bool
31
     */
32
    public function hasIdentity()
33
    {
34
        return $this->getAuthService()->hasIdentity();
35
    }
36
37
    /**
38
     * Proxy convenience method
39
     *
40
     * @return mixed
41
     */
42
    public function getIdentity()
43
    {
44
        return $this->getAuthService()->getIdentity();
45
    }
46
47
    /**
48
     * Get authAdapter.
49
     *
50
     * @return ZfcUserAuthentication
51
     */
52
    public function getAuthAdapter()
53
    {
54
        return $this->authAdapter;
55
    }
56
57
    /**
58
     * Set authAdapter.
59
     *
60
     * @param authAdapter $authAdapter
61
     */
62
    public function setAuthAdapter(AuthAdapter $authAdapter)
63
    {
64
        $this->authAdapter = $authAdapter;
65
        return $this;
66
    }
67
68
    /**
69
     * Get authService.
70
     *
71
     * @return AuthenticationService
72
     */
73
    public function getAuthService()
74
    {
75
        return $this->authService;
76
    }
77
78
    /**
79
     * Set authService.
80
     *
81
     * @param AuthenticationService $authService
82
     */
83
    public function setAuthService(AuthenticationService $authService)
84
    {
85
        $this->authService = $authService;
86
        return $this;
87
    }
88
}
89