JsonRpcCallResponse::getResponseList()   A
last analyzed

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 45
    public function __construct(bool $isBatch = false)
18
    {
19 45
        $this->isBatch = $isBatch;
20
    }
21
22
    /**
23
     * @param JsonRpcResponse $response
24
     *
25
     * @return self
26
     */
27 44
    public function addResponse(JsonRpcResponse $response) : self
28
    {
29 44
        $this->responseList[] = $response;
30
31 44
        return $this;
32
    }
33
34
    /**
35
     * @return boolean
36
     */
37 40
    public function isBatch() : bool
38
    {
39 40
        return $this->isBatch;
40
    }
41
42
    /**
43
     * @return JsonRpcResponse[]
44
     */
45 44
    public function getResponseList() : array
46
    {
47 44
        return $this->responseList;
48
    }
49
}
50