Passed
Pull Request — master (#9)
by Pavel
11:27
created

RpcResponseEvent   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 25%

Importance

Changes 0
Metric Value
dl 0
loc 27
c 0
b 0
f 0
wmc 3
lcom 1
cbo 1
ccs 2
cts 8
cp 0.25
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A hasResponse() 0 4 1
A getResponse() 0 4 1
A setResponse() 0 6 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