Request   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 70
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 2
Bugs 1 Features 0
Metric Value
wmc 5
c 2
b 1
f 0
lcom 0
cbo 0
dl 0
loc 70
rs 10

5 Methods

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