Completed
Branch release/1.0.0 (faa89b)
by Yo
01:45
created

ServerDoc::getVersion()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
namespace Yoanm\JsonRpcServerDoc\Domain\Model;
3
4
/**
5
 * Class ServerDoc
6
 */
7
class ServerDoc
8
{
9
    /** @var string|null */
10
    private $name;
11
    /** @var string|null */
12
    private $version;
13
    /** @var MethodDoc[] */
14
    private $methodList = [];
15
    /** @var TagDoc[] */
16
    private $tagList = [];
17
    /** @var ErrorDoc[] */
18
    private $serverErrorList = [];
19
    /** @var ErrorDoc[] */
20
    private $globalErrorList = [];
21
22
    /**
23
     * @param string $name
24
     *
25
     * @return ServerDoc
26
     */
27 1
    public function setName(string $name) : ServerDoc
28
    {
29 1
        $this->name = $name;
30
31 1
        return $this;
32
    }
33
34
    /**
35
     * @param string $version
36
     *
37
     * @return ServerDoc
38
     */
39 1
    public function setVersion(string $version) : ServerDoc
40
    {
41 1
        $this->version = $version;
42
43 1
        return $this;
44
    }
45
46
    /**
47
     * @param MethodDoc $method
48
     *
49
     * @return ServerDoc
50
     */
51 1
    public function addMethod(MethodDoc $method) : ServerDoc
52
    {
53 1
        $this->methodList[] = $method;
54
55 1
        return $this;
56
    }
57
58
    /**
59
     * @param TagDoc $tag
60
     *
61
     * @return ServerDoc
62
     */
63 1
    public function addTag(TagDoc $tag) : ServerDoc
64
    {
65 1
        $this->tagList[] = $tag;
66
67 1
        return $this;
68
    }
69
70
    /**
71
     * @param ErrorDoc $error
72
     *
73
     * @return ServerDoc
74
     */
75 1
    public function addServerError(ErrorDoc $error) : ServerDoc
76
    {
77 1
        $this->serverErrorList[] = $error;
78
79 1
        return $this;
80
    }
81
82
    /**
83
     * @param ErrorDoc $error
84
     *
85
     * @return ServerDoc
86
     */
87 1
    public function addGlobalError(ErrorDoc $error) : ServerDoc
88
    {
89 1
        $this->globalErrorList[] = $error;
90
91 1
        return $this;
92
    }
93
94
    /**
95
     * @return string|null
96
     */
97 1
    public function getName()
98
    {
99 1
        return $this->name;
100
    }
101
102
    /**
103
     * @return string|null
104
     */
105 1
    public function getVersion()
106
    {
107 1
        return $this->version;
108
    }
109
110
    /**
111
     * @return MethodDoc[]
112
     */
113 1
    public function getMethodList() : array
114
    {
115 1
        return $this->methodList;
116
    }
117
118
    /**
119
     * @return TagDoc[]
120
     */
121 1
    public function getTagList() : array
122
    {
123 1
        return $this->tagList;
124
    }
125
126
    /**
127
     * @return ErrorDoc[]
128
     */
129 1
    public function getServerErrorList() : array
130
    {
131 1
        return $this->serverErrorList;
132
    }
133
134
    /**
135
     * @return ErrorDoc[]
136
     */
137 1
    public function getGlobalErrorList() : array
138
    {
139 1
        return $this->globalErrorList;
140
    }
141
}
142