1 | <?php |
||
6 | trait TypePart { |
||
7 | |||
8 | /** @var string */ |
||
9 | private $type; |
||
10 | |||
11 | /** @var string */ |
||
12 | private $format; |
||
13 | |||
14 | /** @var string */ |
||
15 | private $collectionFormat; |
||
16 | |||
17 | /** @var mixed */ |
||
18 | private $default; |
||
19 | |||
20 | /** @var float */ |
||
21 | private $maximum; |
||
22 | |||
23 | /** @var boolean */ |
||
24 | private $exclusiveMaximum = false; |
||
25 | |||
26 | /** @var float */ |
||
27 | private $minimum; |
||
28 | |||
29 | /** @var boolean */ |
||
30 | private $exclusiveMinimum = false; |
||
31 | |||
32 | /** @var int */ |
||
33 | private $maxLength; |
||
34 | |||
35 | /** @var int */ |
||
36 | private $minLength; |
||
37 | |||
38 | /** @var string */ |
||
39 | private $pattern; |
||
40 | |||
41 | /** @var int */ |
||
42 | private $maxItems; |
||
43 | |||
44 | /** @var int */ |
||
45 | private $minItems; |
||
46 | |||
47 | /** @var boolean */ |
||
48 | private $uniqueItems; |
||
49 | |||
50 | /** @var mixed */ |
||
51 | private $enum; |
||
52 | |||
53 | /** @var float */ |
||
54 | private $multipleOf; |
||
55 | |||
56 | 8 | private function parseType(Map $data) { |
|
74 | |||
75 | 5 | private function getTypeExportFields() { |
|
81 | |||
82 | /** |
||
83 | * |
||
84 | * @return string |
||
85 | */ |
||
86 | 1 | public function getType() { |
|
89 | |||
90 | /** |
||
91 | * |
||
92 | * @param string $type |
||
93 | * @return $this |
||
94 | */ |
||
95 | public function setType($type) { |
||
99 | |||
100 | /** |
||
101 | * |
||
102 | * @return string |
||
103 | */ |
||
104 | public function getFormat() { |
||
107 | |||
108 | /** |
||
109 | * Sets the extending format for the type |
||
110 | * |
||
111 | * @param string $format |
||
112 | * @return $this |
||
113 | */ |
||
114 | public function setFormat($format) { |
||
118 | |||
119 | /** |
||
120 | * |
||
121 | * @return string |
||
122 | */ |
||
123 | public function getCollectionFormat() { |
||
126 | |||
127 | /** |
||
128 | * Determines the format of the array if type array is used. Possible values are: |
||
129 | * |
||
130 | * - `csv` - comma separated values `foo,bar`. |
||
131 | * - `ssv` - space separated values `foo bar`. |
||
132 | * - `tsv` - tab separated values `foo\tbar`. |
||
133 | * - `pipes` - pipe separated values `foo|bar`. |
||
134 | * - `multi` - corresponds to multiple parameter instances instead of multiple values for a |
||
135 | * single instance `foo=bar&foo=baz`. This is valid only for parameters in "query" or "formData". |
||
136 | * |
||
137 | * Default value is `csv`. |
||
138 | * |
||
139 | * |
||
140 | * @param string $collectionFormat |
||
141 | * @return $this |
||
142 | */ |
||
143 | public function setCollectionFormat($collectionFormat) { |
||
147 | |||
148 | /** |
||
149 | * |
||
150 | * @return mixed |
||
151 | */ |
||
152 | public function getDefault() { |
||
155 | |||
156 | /** |
||
157 | * |
||
158 | * @param mixed $default |
||
159 | * @return $this |
||
160 | */ |
||
161 | public function setDefault($default) { |
||
165 | |||
166 | /** |
||
167 | * |
||
168 | * @return float |
||
169 | */ |
||
170 | public function getMaximum() { |
||
173 | |||
174 | /** |
||
175 | * |
||
176 | * @param float $maximum |
||
177 | * @return $this |
||
178 | */ |
||
179 | public function setMaximum($maximum) { |
||
183 | |||
184 | /** |
||
185 | * |
||
186 | * @return boolean |
||
187 | */ |
||
188 | public function isExclusiveMaximum() { |
||
191 | |||
192 | /** |
||
193 | * |
||
194 | * @param boolean $exclusiveMaximum |
||
195 | * @return $this |
||
196 | */ |
||
197 | public function setExclusiveMaximum($exclusiveMaximum) { |
||
201 | |||
202 | /** |
||
203 | * |
||
204 | * @return float |
||
205 | */ |
||
206 | public function getMinimum() { |
||
209 | |||
210 | /** |
||
211 | * |
||
212 | * @param float $minimum |
||
213 | * @return $this |
||
214 | */ |
||
215 | public function setMinimum($minimum) { |
||
219 | |||
220 | /** |
||
221 | * |
||
222 | * @return boolean |
||
223 | */ |
||
224 | public function isExclusiveMinimum() { |
||
227 | |||
228 | /** |
||
229 | * |
||
230 | * @param boolean $exclusiveMinimum |
||
231 | * @return $this |
||
232 | */ |
||
233 | public function setExclusiveMinimum($exclusiveMinimum) { |
||
237 | |||
238 | /** |
||
239 | * |
||
240 | * @return int |
||
241 | */ |
||
242 | public function getMaxLength() { |
||
245 | |||
246 | /** |
||
247 | * |
||
248 | * @param int $maxLength |
||
249 | * @return $this |
||
250 | */ |
||
251 | public function setMaxLength($maxLength) { |
||
255 | |||
256 | /** |
||
257 | * |
||
258 | * @return int |
||
259 | */ |
||
260 | public function getMinLength() { |
||
263 | |||
264 | /** |
||
265 | * |
||
266 | * @param int $minLength |
||
267 | * @return $this |
||
268 | */ |
||
269 | public function setMinLength($minLength) { |
||
273 | |||
274 | /** |
||
275 | * |
||
276 | * @return string |
||
277 | */ |
||
278 | public function getPattern() { |
||
281 | |||
282 | /** |
||
283 | * |
||
284 | * @param string $pattern |
||
285 | * @return $thi |
||
286 | */ |
||
287 | public function setPattern($pattern) { |
||
291 | |||
292 | /** |
||
293 | * |
||
294 | * @return int |
||
295 | */ |
||
296 | public function getMaxItems() { |
||
299 | |||
300 | /** |
||
301 | * |
||
302 | * @param int $maxItems |
||
303 | * @return $this |
||
304 | */ |
||
305 | public function setMaxItems($maxItems) { |
||
309 | |||
310 | /** |
||
311 | * |
||
312 | * @return int |
||
313 | */ |
||
314 | public function getMinItems() { |
||
317 | |||
318 | /** |
||
319 | * |
||
320 | * @param int $minItems |
||
321 | * @return $this |
||
322 | */ |
||
323 | public function setMinItems($minItems) { |
||
327 | |||
328 | /** |
||
329 | * |
||
330 | * @return boolean |
||
331 | */ |
||
332 | public function hasUniqueItems() { |
||
335 | |||
336 | /** |
||
337 | * |
||
338 | * @param boolean $uniqueItems |
||
339 | * @return $this |
||
340 | */ |
||
341 | public function setUniqueItems($uniqueItems) { |
||
345 | |||
346 | /** |
||
347 | * |
||
348 | * @return mixed |
||
349 | */ |
||
350 | public function getEnum() { |
||
353 | |||
354 | /** |
||
355 | * |
||
356 | * @param mixed $enum |
||
357 | * @return $this |
||
358 | */ |
||
359 | public function setEnum($enum) { |
||
363 | |||
364 | /** |
||
365 | * |
||
366 | * @return float |
||
367 | */ |
||
368 | public function getMultipleOf() { |
||
371 | |||
372 | /** |
||
373 | * |
||
374 | * @param float $multipleOf |
||
375 | * @return $this |
||
376 | */ |
||
377 | public function setMultipleOf($multipleOf) { |
||
381 | |||
382 | |||
383 | |||
384 | |||
385 | } |
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.
To visualize
will produce issues in the first and second line, while this second example
will produce no issues.