AuthenticationEvent::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 3
1
<?php
2
namespace T4web\Authentication;
3
4
use Zend\Authentication\Adapter\AdapterInterface;
5
use Zend\Authentication\Result;
6
use Zend\EventManager\Event;
7
8
/**
9
 * Class AuthenticationEvent
10
 */
11
class AuthenticationEvent extends Event
12
{
13
    /**
14
     * Events triggered by eventmanager
15
     */
16
    const EVENT_AUTH = 'auth';
17
18
    /**
19
     * @var AdapterInterface
20
     */
21
    protected $adapter;
22
23
    /**
24
     * @var Result
25
     */
26
    protected $result;
27
28
    /**
29
     * Constructor
30
     *
31
     * Accept a target and its parameters.
32
     *
33
     * @param  string $name Event name
34
     * @param  string|object $target
35
     * @param  array|ArrayAccess $params
36
     */
37
    public function __construct($name = null, $target = null, $params = null)
38
    {
39
        parent::__construct(self::EVENT_AUTH, $target, $params);
40
    }
41
42
    /**
43
     * @param AdapterInterface $adapter
44
     * @return $this
45
     */
46
    public function setAdapter(AdapterInterface $adapter)
47
    {
48
        $this->adapter = $adapter;
49
        return $this;
50
    }
51
52
    /**
53
     * @return AdapterInterface
54
     */
55
    public function getAdapter()
56
    {
57
        return $this->adapter;
58
    }
59
60
    /**
61
     * @param Result $result
62
     * @return $this
63
     */
64
    public function setResult(Result $result)
65
    {
66
        $this->result = $result;
67
        return $this;
68
    }
69
70
    /**
71
     * @return Result
72
     */
73
    public function getResult()
74
    {
75
        return $this->result;
76
    }
77
}
78