Passed
Push — master ( 72ba5d...808b88 )
by Yo
01:00 queued 10s
created

JsonRpcCallResponse::getResponseList()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
namespace Yoanm\JsonRpcServer\Domain\Model;
3
4
/**
5
 * Class JsonRpcCallResponse
6
 */
7
class JsonRpcCallResponse
8
{
9
    /** @var bool */
10
    private $isBatch;
11
    /** @var JsonRpcResponse[] */
12
    private $responseList = [];
13
14
    /**
15
     * @param bool $isBatch
16
     */
17 2
    public function __construct(bool $isBatch = false)
18
    {
19 2
        $this->isBatch = $isBatch;
20 2
    }
21
22
    /**
23
     * @param JsonRpcResponse $response
24
     *
25
     * @return self
26
     */
27 1
    public function addResponse(JsonRpcResponse $response) : self
28
    {
29 1
        $this->responseList[] = $response;
30
31 1
        return $this;
32
    }
33
34
    /**
35
     * @return boolean
36
     */
37 1
    public function isBatch() : bool
38
    {
39 1
        return $this->isBatch;
40
    }
41
42
    /**
43
     * @return JsonRpcResponse[]
44
     */
45 1
    public function getResponseList() : array
46
    {
47 1
        return $this->responseList;
48
    }
49
}
50