Completed
Push — master ( 17991e...a18769 )
by Gianluca
04:56 queued 02:15
created

CakeHttpFlowEvent::stopPropagation()   A

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
namespace Penny\Event;
3
4
use Exception;
5
use Cake\Event\Event as BaseCakeEvent;
6
use Penny\Route\RouteInfoInterface;
7
8
class CakeHttpFlowEvent extends BaseCakeEvent implements PennyEventInterface
9
{
10
    /**
11
     * Representation of an outgoing, client-side request.
12
     *
13
     * @var mixed
14
     */
15
    private $request;
16
17
    /**
18
     * Representation of an outgoing, server-side response.
19
     *
20
     * @var mixed
21
     */
22
    private $response;
23
24
    /**
25
     * Exception thrown during execution.
26
     *
27
     * @var Exception
28
     */
29
    private $exception;
30
31
    /**
32
     * Routing information.
33
     *
34
     * @var RouteInfoInterface
35
     */
36
    private $routeInfo;
37
38
    /**
39
     * {@inheritDoc}
40
     */
41 14
    public function __construct($name, $subject = null, $data = null)
42
    {
43 14
        $this->setName($name);
44 14
        $this->data = $data;
45 14
        $this->_subject = $subject;
46 14
    }
47
48
    /**
49
     * {@inheritDoc}
50
     */
51 14
    public function setName($name)
52
    {
53 14
        $this->_name = $name;
54 14
    }
55
56
    /**
57
     * {@inheritDoc}
58
     */
59 2
    public function getName()
60
    {
61 2
        return $this->name();
62
    }
63
64
    /**
65
     * {@inheritDoc}
66
     */
67 2
    public function getResponse()
68
    {
69 2
        return $this->response;
70
    }
71
72
    /**
73
     * {@inheritDoc}
74
     */
75 2
    public function setResponse($response)
76
    {
77 2
        $this->response = $response;
78 2
    }
79
80
    /**
81
     * {@inheritDoc}
82
     */
83 2
    public function setRequest($request)
84
    {
85 2
        $this->request = $request;
86 2
    }
87
88
    /**
89
     * {@inheritDoc}
90
     */
91 2
    public function getRequest()
92
    {
93 2
        return $this->request;
94
    }
95
96
    /**
97
     * {@inheritDoc}
98
     */
99 2
    public function getRouteInfo()
100
    {
101 2
        return $this->routeInfo;
102
    }
103
104
    /**
105
     * {@inheritDoc}
106
     */
107 2
    public function setRouteInfo(RouteInfoInterface $routerInfo)
108
    {
109 2
        $this->routeInfo = $routerInfo;
110 2
    }
111
112
    /**
113
     * {@inheritDoc}
114
     */
115 2
    public function setException(Exception $exception)
116
    {
117 2
        $this->exception = $exception;
118 2
    }
119
120
    /**
121
     * {@inheritDoc}
122
     */
123 2
    public function getException()
124
    {
125 2
        return $this->exception;
126
    }
127
128
    /**
129
     * {@inheritDoc}
130
     */
131 2
    public function stopPropagation($flag = true)
132
    {
133 2
        $this->_stopped = $flag;
134 2
    }
135
}
136