ZendHttpFlowEvent::setException()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 1
crap 1
1
<?php
2
3
namespace Penny\Event;
4
5
use Exception;
6
use Penny\Route\RouteInfoInterface;
7
use Zend\EventManager\Event;
8
9
class ZendHttpFlowEvent extends Event implements EventInterface
10
{
11
    /**
12
     * Representation of an outgoing, client-side request.
13
     *
14
     * @var mixed
15
     */
16
    private $request;
17
18
    /**
19
     * Representation of an outgoing, server-side response.
20
     *
21
     * @var mixed
22
     */
23
    private $response;
24
25
    /**
26
     * Exception thrown during execution.
27
     *
28
     * @var Exception
29
     */
30
    private $exception;
31
32
    /**
33
     * Routing information.
34
     *
35
     * @var RouteInfoInterface
36
     */
37
    private $routeInfo;
38
39 19
    public function __construct($name, $request, $response)
40
    {
41 19
        $this->setName($name);
42 19
        $this->setRequest($request);
43 19
        $this->setResponse($response);
44 19
    }
45
46
    /**
47
     * {@inheritDoc}
48
     */
49 15
    public function getResponse()
50
    {
51 15
        return $this->response;
52
    }
53
54
    /**
55
     * {@inheritDoc}
56
     */
57 19
    public function setResponse($response)
58
    {
59 19
        $this->response = $response;
60 19
    }
61
62
    /**
63
     * {@inheritDoc}
64
     */
65 19
    public function setRequest($request)
66
    {
67 19
        $this->request = $request;
68 19
    }
69
70
    /**
71
     * {@inheritDoc}
72
     */
73 15
    public function getRequest()
74
    {
75 15
        return $this->request;
76
    }
77
78
    /**
79
     * Route info getter.
80
     *
81
     * @return RouteInfoInterface
82
     */
83 1
    public function getRouteInfo()
84
    {
85 1
        return $this->routeInfo;
86
    }
87
88
    /**
89
     * Route info setter.
90
     *
91
     * @param RouteInfoInterface $routerInfo Routing information.
92
     */
93 12
    public function setRouteInfo(RouteInfoInterface $routerInfo)
94
    {
95 12
        $this->routeInfo = $routerInfo;
96 12
    }
97
98
    /**
99
     * Exception setter.
100
     *
101
     * @param Exception $exception Exception thrown during execution.
102
     */
103 5
    public function setException(Exception $exception)
104
    {
105 5
        $this->exception = $exception;
106 5
    }
107
108
    /**
109
     * Exception getter.
110
     *
111
     * @return Exception
112
     */
113 4
    public function getException()
114
    {
115 4
        return $this->exception;
116
    }
117
}
118