RpcGeneralDefinition::getDefinitions()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

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