We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | */ |
61 | 61 | public function setValidation($classOrRulesArray = false, $messages = []) |
62 | 62 | { |
63 | - if (! $classOrRulesArray) { |
|
63 | + if (!$classOrRulesArray) { |
|
64 | 64 | $this->setValidationFromFields(); |
65 | 65 | } elseif (is_array($classOrRulesArray)) { |
66 | 66 | $this->setValidationFromArray($classOrRulesArray, $messages); |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | return $this->checkRequestValidity($extendedRules, $extendedMessages, $formRequest); |
140 | 140 | } |
141 | 141 | |
142 | - return ! empty($rules) ? $this->checkRequestValidity($rules, $messages) : $this->getRequest(); |
|
142 | + return !empty($rules) ? $this->checkRequestValidity($rules, $messages) : $this->getRequest(); |
|
143 | 143 | } |
144 | 144 | |
145 | 145 | /** |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | */ |
225 | 225 | public function isRequired($inputKey) |
226 | 226 | { |
227 | - if (! $this->hasOperationSetting('requiredFields')) { |
|
227 | + if (!$this->hasOperationSetting('requiredFields')) { |
|
228 | 228 | return false; |
229 | 229 | } |
230 | 230 | |
@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | { |
246 | 246 | [$rules, $messages] = $this->getValidationRulesAndMessagesFromField($field, $parent); |
247 | 247 | |
248 | - if (! empty($rules)) { |
|
248 | + if (!empty($rules)) { |
|
249 | 249 | $this->setValidation($rules, $messages); |
250 | 250 | } |
251 | 251 | } |
@@ -260,10 +260,10 @@ discard block |
||
260 | 260 | { |
261 | 261 | $messages = []; |
262 | 262 | collect($fields) |
263 | - ->filter(function ($value, $key) { |
|
263 | + ->filter(function($value, $key) { |
|
264 | 264 | // only keep fields where 'validationMessages' OR there are subfields |
265 | 265 | return array_key_exists('validationMessages', $value) || array_key_exists('subfields', $value); |
266 | - })->each(function ($item, $key) use (&$messages) { |
|
266 | + })->each(function($item, $key) use (&$messages) { |
|
267 | 267 | if (isset($item['validationMessages'])) { |
268 | 268 | foreach ($item['validationMessages'] as $rule => $message) { |
269 | 269 | $messages[$key.'.'.$rule] = $message; |
@@ -271,7 +271,7 @@ discard block |
||
271 | 271 | } |
272 | 272 | // add messages from subfields |
273 | 273 | if (array_key_exists('subfields', $item)) { |
274 | - $subfieldsWithValidationMessages = array_filter($item['subfields'], function ($subfield) { |
|
274 | + $subfieldsWithValidationMessages = array_filter($item['subfields'], function($subfield) { |
|
275 | 275 | return array_key_exists('validationRules', $subfield); |
276 | 276 | }); |
277 | 277 | |
@@ -295,10 +295,10 @@ discard block |
||
295 | 295 | private function getValidationRulesFromFieldsAndSubfields($fields) |
296 | 296 | { |
297 | 297 | $rules = collect($fields) |
298 | - ->filter(function ($value, $key) { |
|
298 | + ->filter(function($value, $key) { |
|
299 | 299 | // only keep fields where 'validationRules' OR there are subfields |
300 | 300 | return array_key_exists('validationRules', $value) || array_key_exists('subfields', $value); |
301 | - })->map(function ($item, $key) { |
|
301 | + })->map(function($item, $key) { |
|
302 | 302 | $validationRules = []; |
303 | 303 | // only keep the rules, not the entire field definition |
304 | 304 | if (isset($item['validationRules'])) { |
@@ -306,7 +306,7 @@ discard block |
||
306 | 306 | } |
307 | 307 | // add validation rules for subfields |
308 | 308 | if (array_key_exists('subfields', $item)) { |
309 | - $subfieldsWithValidation = array_filter($item['subfields'], function ($subfield) { |
|
309 | + $subfieldsWithValidation = array_filter($item['subfields'], function($subfield) { |
|
310 | 310 | return array_key_exists('validationRules', $subfield); |
311 | 311 | }); |
312 | 312 | |
@@ -364,7 +364,7 @@ discard block |
||
364 | 364 | { |
365 | 365 | $extendedRules = []; |
366 | 366 | $requestRules = $this->getRequestRulesAsArray($request); |
367 | - $rules = array_map(function ($ruleDefinition) { |
|
367 | + $rules = array_map(function($ruleDefinition) { |
|
368 | 368 | return is_array($ruleDefinition) ? $ruleDefinition : explode('|', $ruleDefinition); |
369 | 369 | }, $rules); |
370 | 370 |
@@ -77,13 +77,13 @@ discard block |
||
77 | 77 | /** |
78 | 78 | * Set the rules that apply to the "array" aka the field, if it's required, min, max etc. |
79 | 79 | */ |
80 | - public function arrayRules(string|array|File $rules): self |
|
80 | + public function arrayRules(string | array | File $rules): self |
|
81 | 81 | { |
82 | 82 | if (is_string($rules)) { |
83 | 83 | $rules = explode('|', $rules); |
84 | 84 | } |
85 | 85 | |
86 | - if (! in_array('array', $rules)) { |
|
86 | + if (!in_array('array', $rules)) { |
|
87 | 87 | $rules[] = 'array'; |
88 | 88 | } |
89 | 89 | |
@@ -95,12 +95,12 @@ discard block |
||
95 | 95 | /** |
96 | 96 | * Set the rules that apply to the files beeing uploaded. |
97 | 97 | */ |
98 | - public function fileRules(string|array|File $rules): self |
|
98 | + public function fileRules(string | array | File $rules): self |
|
99 | 99 | { |
100 | 100 | if (is_string($rules)) { |
101 | 101 | $rules = explode('|', $rules); |
102 | 102 | } |
103 | - if (! is_array($rules)) { |
|
103 | + if (!is_array($rules)) { |
|
104 | 104 | $rules = [$rules]; |
105 | 105 | } |
106 | 106 | $this->fileRules = $rules; |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | protected function validateFiles($attribute, $files, $fail) |
120 | 120 | { |
121 | 121 | foreach ($files as $file) { |
122 | - if (! is_file($file)) { |
|
122 | + if (!is_file($file)) { |
|
123 | 123 | continue; |
124 | 124 | } |
125 | 125 | $validator = Validator::make([$attribute => $file], [ |
@@ -17,10 +17,10 @@ discard block |
||
17 | 17 | */ |
18 | 18 | public function validate(string $attribute, mixed $value, Closure $fail): void |
19 | 19 | { |
20 | - if (! is_array($value)) { |
|
20 | + if (!is_array($value)) { |
|
21 | 21 | try { |
22 | 22 | $value = json_decode($value, true); |
23 | - } catch(\Exception $e) { |
|
23 | + } catch (\Exception $e) { |
|
24 | 24 | $fail('Unable to determine the value type'); |
25 | 25 | |
26 | 26 | return; |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | $value = array_merge($previousValues, $value); |
43 | 43 | |
44 | 44 | // if user uploaded something add it to the data beeing validated. |
45 | - if (! empty($value)) { |
|
45 | + if (!empty($value)) { |
|
46 | 46 | $this->data[$attribute] = $value; |
47 | 47 | } |
48 | 48 |