Passed
Push — master ( 047a07...27593a )
by Dmitry
02:43
created

AbstractResponse::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

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