Completed
Push — master ( 39b3fc...3ebb26 )
by Sergey
12:04 queued 07:06
created

RpcGeneralDefinition::setJrgen()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 5
ccs 0
cts 3
cp 0
crap 2
rs 10
1
<?php
2
3
/**
4
 * Created by PhpStorm.
5
 * Project: json-rpc-server
6
 * User: sv
7
 * Date: 06.02.2021
8
 * Time: 10:47
9
 */
10
11
declare(strict_types=1);
12
13
namespace Onnov\JsonRpcServer\Definition;
14
15
use stdClass;
16
17
/**
18
 * Class RpcGeneralDefinition
19
 * @package Onnov\JsonRpcServer\Definition
20
 */
21
class RpcGeneralDefinition
22
{
23
    use CastableToArray;
24
25
    /**
26
     * https://github.com/mzernetsch/jrgen
27
     *
28
     * @var string
29
     */
30
    private $schema = 'https://rawgit.com/mzernetsch/jrgen/master/jrgen-spec.schema.json';
31
32
    /**
33
     * Version of the jrgen spec.
34
     *
35
     * @var string
36
     */
37
    private $jrgen = '1.1';
38
39
    /**
40
     * Version of the json-rpc protocol.
41
     *
42
     * @var string
43
     */
44
    private $jsonrpc = '2.0';
45
46
    /**
47
     * Meta information about the api.
48
     *
49
     * @var RpcInfoDefinition
50
     */
51
    private $info;
52
53
    /**
54
     * Global definitions for use in the api
55
     *
56
     * @var stdClass|null
57
     */
58
    private $definitions = null;
59
60
    /**
61
     * @return string
62
     */
63
    public function getSchema(): string
64
    {
65
        return $this->schema;
66
    }
67
68
    /**
69
     * @param string $schema
70
     */
71
    public function setSchema(string $schema): void
72
    {
73
        $this->schema = $schema;
74
    }
75
76
    /**
77
     * @return string
78
     */
79
    public function getJrgen(): string
80
    {
81
        return $this->jrgen;
82
    }
83
84
    /**
85
     * @param string $jrgen
86
     * @return RpcGeneralDefinition
87
     */
88
    public function setJrgen(string $jrgen): self
89
    {
90
        $this->jrgen = $jrgen;
91
92
        return $this;
93
    }
94
95
    /**
96
     * @return string
97
     */
98
    public function getJsonrpc(): string
99
    {
100
        return $this->jsonrpc;
101
    }
102
103
    /**
104
     * @param string $jsonrpc
105
     * @return RpcGeneralDefinition
106
     */
107
    public function setJsonrpc(string $jsonrpc): self
108
    {
109
        $this->jsonrpc = $jsonrpc;
110
111
        return $this;
112
    }
113
114
    /**
115
     * @return RpcInfoDefinition
116
     */
117
    public function getInfo(): RpcInfoDefinition
118
    {
119
        return $this->info;
120
    }
121
122
    /**
123
     * @param RpcInfoDefinition $info
124
     * @return RpcGeneralDefinition
125
     */
126
    public function setInfo(RpcInfoDefinition $info): self
127
    {
128
        $this->info = $info;
129
130
        return $this;
131
    }
132
133
    /**
134
     * @return stdClass|null
135
     */
136
    public function getDefinitions(): ?stdClass
137
    {
138
        return $this->definitions;
139
    }
140
141
    /**
142
     * @param stdClass|null $definitions
143
     * @return RpcGeneralDefinition
144
     */
145
    public function setDefinitions(?stdClass $definitions): self
146
    {
147
        $this->definitions = $definitions;
148
149
        return $this;
150
    }
151
}
152