Request::getVersion()   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\Request;
4
5
/**
6
 * Represents JSON-RPC request.
7
 */
8
class Request
9
{
10
    /**
11
     * @var string
12
     */
13
    private $version;
14
15
    /**
16
     * @var mixed
17
     */
18
    private $id;
19
20
    /**
21
     * @var string
22
     */
23
    private $method;
24
25
    /**
26
     * @var array
27
     */
28
    private $params;
29
30
    /**
31
     * Constructor.
32
     *
33
     * @param string $version
34
     * @param mixed  $id
35
     * @param string $method
36
     * @param array  $params
37
     */
38
    public function __construct($version, $id, $method, array $params = [])
39
    {
40
        $this->version = $version;
41
        $this->id = $id;
42
        $this->method = $method;
43
        $this->params = $params;
44
    }
45
46
    /**
47
     * @return string
48
     */
49
    public function getVersion()
50
    {
51
        return $this->version;
52
    }
53
54
    /**
55
     * @return mixed
56
     */
57
    public function getId()
58
    {
59
        return $this->id;
60
    }
61
62
    /**
63
     * @return string
64
     */
65
    public function getMethod()
66
    {
67
        return $this->method;
68
    }
69
70
    /**
71
     * @return array
72
     */
73
    public function getParams()
74
    {
75
        return $this->params;
76
    }
77
}
78