Passed
Pull Request — master (#2)
by Sergey
03:11
created

RpcModel   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 76
Duplicated Lines 0 %

Test Coverage

Coverage 73.68%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 8
eloc 13
c 1
b 0
f 0
dl 0
loc 76
ccs 14
cts 19
cp 0.7368
rs 10

8 Methods

Rating   Name   Duplication   Size   Complexity  
A getMethod() 0 3 1
A setJsonrpc() 0 3 1
A getParams() 0 3 1
A getId() 0 3 1
A getJsonrpc() 0 3 1
A setParams() 0 3 1
A setId() 0 3 1
A setMethod() 0 3 1
1
<?php
2
3
/**
4
 * Created by PhpStorm.
5
 * Project: json-rpc-server
6
 * User: sv
7
 * Date: 06.01.2021
8
 * Time: 13:33
9
 */
10
11
declare(strict_types=1);
12
13
namespace Onnov\JsonRpcServer\Model;
14
15
/**
16
 * Class RpcModel
17
 * @package Onnov\JsonRpcServer\Model
18
 */
19
class RpcModel
20
{
21
    /** @var string */
22
    private $jsonrpc;
23
24
    /** @var string */
25
    private $method;
26
27
    /** @var mixed|null */
28
    private $params;
29
30
    /** @var mixed|null */
31
    private $id;
32
33
    /**
34
     * @return string
35
     */
36
    public function getJsonrpc(): string
37
    {
38
        return $this->jsonrpc;
39
    }
40
41
    /**
42
     * @param string $jsonrpc
43
     */
44 4
    public function setJsonrpc(string $jsonrpc): void
45
    {
46 4
        $this->jsonrpc = $jsonrpc;
47 4
    }
48
49
    /**
50
     * @return string
51
     */
52 4
    public function getMethod(): string
53
    {
54 4
        return $this->method;
55
    }
56
57
    /**
58
     * @param string $method
59
     */
60 4
    public function setMethod(string $method): void
61
    {
62 4
        $this->method = $method;
63 4
    }
64
65
    /**
66
     * @return mixed|null
67
     */
68 2
    public function getParams()
69
    {
70 2
        return $this->params;
71
    }
72
73
    /**
74
     * @param mixed|null $params
75
     */
76
    public function setParams($params): void
77
    {
78
        $this->params = $params;
79
    }
80
81
    /**
82
     * @return mixed|null
83
     */
84 2
    public function getId()
85
    {
86 2
        return $this->id;
87
    }
88
89
    /**
90
     * @param mixed|null $id
91
     */
92 4
    public function setId($id): void
93
    {
94 4
        $this->id = $id;
95 4
    }
96
}
97