Passed
Pull Request — master (#9)
by Pavel
12:36
created

RpcResponseEvent::hasResponse()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
ccs 2
cts 2
cp 1
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Bankiru\Api\Rpc\Event;
4
5
use Bankiru\Api\Rpc\RpcEvent;
6
use ScayTrase\Api\Rpc\RpcResponseInterface;
7
8
class RpcResponseEvent extends RpcEvent
9
{
10
    /** @var  RpcResponseInterface|null */
11
    protected $response;
12
13
    /** @return bool */
14 9
    public function hasResponse()
15
    {
16 9
        return null !== $this->response;
17
    }
18
19
    /** @return RpcResponseInterface */
20
    public function getResponse()
21
    {
22
        return $this->response;
23
    }
24
25
    /**
26
     * @param RpcResponseInterface $response
27
     */
28
    public function setResponse(RpcResponseInterface $response)
29
    {
30
        $this->response = $response;
31
32
        $this->stopPropagation();
33
    }
34
}
35