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

AbstractResponse   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 1
Bugs 1 Features 0
Metric Value
wmc 3
c 1
b 1
f 0
lcom 1
cbo 0
dl 0
loc 35
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getId() 0 4 1
A toArray() 0 6 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