Passed
Branch 2.0 (f5ddb0)
by Samuel
04:04
created

Error::setId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace SMartins\Exceptions\JsonApi;
4
5
use SMartins\Exceptions\JsonApi\Links;
6
use SMartins\Exceptions\JsonApi\Source;
7
use Illuminate\Contracts\Support\Arrayable;
8
use SMartins\Exceptions\Traits\NotNullArrayable;
9
10
class Error implements Arrayable
11
{
12
    use NotNullArrayable;
13
14
    /**
15
     * A unique identifier for this particular occurrence of the problem.
16
     *
17
     * @var string
18
     */
19
    protected $id;
20
21
    /**
22
     * @var \SMartins\Exceptions\JsonApi\Links
23
     */
24
    protected $links;
25
26
    /**
27
     * The HTTP status code applicable to this problem, expressed as a string value.
28
     *
29
     * @var string
30
     */
31
    protected $status;
32
33
    /**
34
     * An application-specific error code, expressed as a string value.
35
     *
36
     * @var string
37
     */
38
    protected $code;
39
40
    /**
41
     * A short, human-readable summary of the problem that SHOULD NOT change from
42
     * occurrence to occurrence of the problem, except for purposes of localization.
43
     *
44
     * @var string
45
     */
46
    protected $title;
47
48
    /**
49
     * A human-readable explanation specific to this occurrence of the problem.
50
     * Like title, this field’s value can be localized.
51
     *
52
     * @var string
53
     */
54
    protected $detail;
55
56
    /**
57
     * An object containing references to the source of the error.
58
     *
59
     * @var \SMartins\Exceptions\JsonApi\Source
60
     */
61
    protected $source;
62
63
    /**
64
     * Get a unique identifier for this particular occurrence of the problem.
65
     *
66
     * @return  string
67
     */
68
    public function getId()
69
    {
70
        return $this->id;
71
    }
72
73
    /**
74
     * Set a unique identifier for this particular occurrence of the problem.
75
     *
76
     * @param  string  $id
77
     *
78
     * @return  self
79
     */
80
    public function setId(string $id)
81
    {
82
        $this->id = $id;
83
84
        return $this;
85
    }
86
87
    /**
88
     * Get the value of links
89
     *
90
     * @return  \SMartins\Exceptions\JsonApi\Links
91
     */
92
    public function getLinks()
93
    {
94
        return $this->links;
95
    }
96
97
    /**
98
     * Set the value of links
99
     *
100
     * @param  \SMartins\Exceptions\JsonApi\Links  $links
101
     *
102
     * @return  self
103
     */
104
    public function setLinks(Links $links)
105
    {
106
        $this->links = $links;
107
108
        return $this;
109
    }
110
111
    /**
112
     * Get the HTTP status code applicable to this problem, expressed as a string value.
113
     *
114
     * @return  string
115
     */
116
    public function getStatus()
117
    {
118
        return $this->status;
119
    }
120
121
    /**
122
     * Set the HTTP status code applicable to this problem, expressed as a string value.
123
     *
124
     * @param  string  $status
125
     *
126
     * @return  self
127
     */
128
    public function setStatus(string $status)
129
    {
130
        $this->status = $status;
131
132
        return $this;
133
    }
134
135
    /**
136
     * Get an application-specific error code, expressed as a string value.
137
     *
138
     * @return  string
139
     */
140
    public function getCode()
141
    {
142
        return $this->code;
143
    }
144
145
    /**
146
     * Set an application-specific error code, expressed as a string value.
147
     *
148
     * @param  string  $code
149
     *
150
     * @return  self
151
     */
152
    public function setCode(string $code)
153
    {
154
        $this->code = $code;
155
156
        return $this;
157
    }
158
159
    /**
160
     * Get occurrence to occurrence of the problem, except for purposes of localization.
161
     *
162
     * @return  string
163
     */
164
    public function getTitle()
165
    {
166
        return $this->title;
167
    }
168
169
    /**
170
     * Set occurrence to occurrence of the problem, except for purposes of localization.
171
     *
172
     * @param  string  $title
173
     *
174
     * @return  self
175
     */
176
    public function setTitle(string $title)
177
    {
178
        $this->title = $title;
179
180
        return $this;
181
    }
182
183
    /**
184
     * Get like title, this field’s value can be localized.
185
     *
186
     * @return  string
187
     */
188
    public function getDetail()
189
    {
190
        return $this->detail;
191
    }
192
193
    /**
194
     * Set like title, this field’s value can be localized.
195
     *
196
     * @param  string  $detail
197
     *
198
     * @return  self
199
     */
200
    public function setDetail(string $detail)
201
    {
202
        $this->detail = $detail;
203
204
        return $this;
205
    }
206
207
    /**
208
     * Get an object containing references to the source of the error.
209
     *
210
     * @return  \SMartins\Exceptions\JsonApi\Source
211
     */
212
    public function getSource()
213
    {
214
        return $this->source;
215
    }
216
217
    /**
218
     * Set an object containing references to the source of the error.
219
     *
220
     * @param  \SMartins\Exceptions\JsonApi\Source  $source
221
     *
222
     * @return  self
223
     */
224
    public function setSource(Source $source)
225
    {
226
        $this->source = $source;
227
228
        return $this;
229
    }
230
}
231