You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/Common/Api/Parameter.php
+3-30Lines changed: 3 additions & 30 deletions
Original file line number
Diff line number
Diff line change
@@ -118,9 +118,6 @@ class Parameter
118
118
*/
119
119
private$enum;
120
120
121
-
/**
122
-
* @param array $data
123
-
*/
124
121
publicfunction__construct(array$data)
125
122
{
126
123
$this->hydrate($data);
@@ -163,8 +160,6 @@ private function stockProperties(array $data)
163
160
164
161
/**
165
162
* Retrieve the name that will be used over the wire.
166
-
*
167
-
* @return string
168
163
*/
169
164
publicfunctiongetName(): string
170
165
{
@@ -173,8 +168,6 @@ public function getName(): string
173
168
174
169
/**
175
170
* Indicates whether the user must provide a value for this parameter.
176
-
*
177
-
* @return bool
178
171
*/
179
172
publicfunctionisRequired(): bool
180
173
{
@@ -207,24 +200,14 @@ public function validate($userValues): bool
207
200
privatefunctionvalidateEnums($userValues)
208
201
{
209
202
if (!empty($this->enum) && 'string' == $this->type && !in_array($userValues, $this->enum)) {
210
-
thrownew \Exception(sprintf(
211
-
'The only permitted values are %s. You provided %s',
212
-
implode(', ', $this->enum),
213
-
print_r($userValues, true)
214
-
));
203
+
thrownew \Exception(sprintf('The only permitted values are %s. You provided %s', implode(', ', $this->enum), print_r($userValues, true)));
215
204
}
216
205
}
217
206
218
207
privatefunctionvalidateType($userValues)
219
208
{
220
209
if (!$this->hasCorrectType($userValues)) {
221
-
thrownew \Exception(sprintf(
222
-
'The key provided "%s" has the wrong value type. You provided %s (%s) but was expecting %s',
223
-
$this->name,
224
-
print_r($userValues, true),
225
-
gettype($userValues),
226
-
$this->type
227
-
));
210
+
thrownew \Exception(sprintf('The key provided "%s" has the wrong value type. You provided %s (%s) but was expecting %s', $this->name, print_r($userValues, true), gettype($userValues), $this->type));
228
211
}
229
212
}
230
213
@@ -268,8 +251,6 @@ private function getNestedProperty($key): Parameter
268
251
* by this parameter.
269
252
*
270
253
* @param $userValue The value being checked
271
-
*
272
-
* @return bool
273
254
*/
274
255
privatefunctionhasCorrectType($userValue): bool
275
256
{
@@ -302,8 +283,6 @@ private function hasCorrectType($userValue): bool
302
283
303
284
/**
304
285
* Indicates whether this parameter represents an array type.
305
-
*
306
-
* @return bool
307
286
*/
308
287
publicfunctionisArray(): bool
309
288
{
@@ -312,8 +291,6 @@ public function isArray(): bool
312
291
313
292
/**
314
293
* Indicates whether this parameter represents an object type.
315
-
*
316
-
* @return bool
317
294
*/
318
295
publicfunctionisObject(): bool
319
296
{
@@ -329,8 +306,6 @@ public function getLocation(): string
329
306
* Verifies whether the given location matches the parameter's location.
330
307
*
331
308
* @param $value
332
-
*
333
-
* @return bool
334
309
*/
335
310
publicfunctionhasLocation($value): bool
336
311
{
@@ -359,8 +334,6 @@ public function getItemSchema()
359
334
360
335
/**
361
336
* Sets the name of the parameter to a new value.
362
-
*
363
-
* @param string $name
364
337
*/
365
338
publicfunctionsetName(string$name)
366
339
{
@@ -372,7 +345,7 @@ public function setName(string $name)
372
345
*
373
346
* @param string $name The name of the child property
0 commit comments