SuccessResponse::getResult()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Tonic\Component\ApiLayer\JsonRpc\Response;
4
5
/**
6
 * Represents success response.
7
 */
8
class SuccessResponse extends AbstractResponse
9
{
10
    /**
11
     * @var mixed
12
     */
13
    private $result;
14
15
    /**
16
     * Constructor.
17
     *
18
     * @param mixed $id
19
     * @param mixed $result
20
     */
21
    public function __construct($id, $result)
22
    {
23
        parent::__construct($id);
24
25
        $this->result = $result;
26
    }
27
28
    /**
29
     * @return mixed
30
     */
31
    public function getResult()
32
    {
33
        return $this->result;
34
    }
35
36
    /**
37
     * @return array
38
     */
39
    public function toArray()
40
    {
41
        return array_merge(parent::toArray(), [
42
            'result' => $this->getResult(),
43
        ]);
44
    }
45
}
46