ResponseEvent::hasResponse()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
/*
3
 * This file is part of the Borobudur-Kernel package.
4
 *
5
 * (c) Hexacodelabs <http://hexacodelabs.com>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace Borobudur\Kernel\Event;
12
13
use Borobudur\Http\Response;
14
15
/**
16
 * @author      Iqbal Maulana <[email protected]>
17
 * @created     8/13/15
18
 */
19
class ResponseEvent extends KernelEvent
20
{
21
    /**
22
     * @var Response
23
     */
24
    protected $response;
25
26
    /**
27
     * Set response.
28
     *
29
     * @param Response $response
30
     */
31
    public function setResponse(Response $response)
32
    {
33
        $this->response = $response;
34
        $this->stopPropagation();
35
    }
36
37
    /**
38
     * Get response.
39
     *
40
     * @return Response
41
     */
42
    public function getResponse()
43
    {
44
        return $this->response;
45
    }
46
47
    /**
48
     * Check if event has response.
49
     *
50
     * @return bool
51
     */
52
    public function hasResponse()
53
    {
54
        return null !== $this->response;
55
    }
56
}
57