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 |
@@ -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 |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | */ |
49 | 49 | public function validate(string $attribute, mixed $value, Closure $fail): void |
50 | 50 | { |
51 | - if (! is_array($value)) { |
|
51 | + if (!is_array($value)) { |
|
52 | 52 | try { |
53 | 53 | $value = json_decode($value, true); |
54 | 54 | } catch (\Exception $e) { |
@@ -91,13 +91,13 @@ discard block |
||
91 | 91 | /** |
92 | 92 | * Set the rules that apply to the "array" aka the field, if it's required, min, max etc. |
93 | 93 | */ |
94 | - public function arrayRules(string|array|File $rules): self |
|
94 | + public function arrayRules(string | array | File $rules): self |
|
95 | 95 | { |
96 | 96 | if (is_string($rules)) { |
97 | 97 | $rules = explode('|', $rules); |
98 | 98 | } |
99 | 99 | |
100 | - if (! in_array('array', $rules)) { |
|
100 | + if (!in_array('array', $rules)) { |
|
101 | 101 | $rules[] = 'array'; |
102 | 102 | } |
103 | 103 | |
@@ -109,13 +109,13 @@ discard block |
||
109 | 109 | /** |
110 | 110 | * Set the rules that apply to the items beeing sent in array. |
111 | 111 | */ |
112 | - public function itemRules(string|array|File $rules): self |
|
112 | + public function itemRules(string | array | File $rules): self |
|
113 | 113 | { |
114 | 114 | if (is_string($rules)) { |
115 | 115 | $rules = explode('|', $rules); |
116 | 116 | } |
117 | 117 | |
118 | - if (! is_array($rules)) { |
|
118 | + if (!is_array($rules)) { |
|
119 | 119 | $rules = [$rules]; |
120 | 120 | } |
121 | 121 | |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | */ |
158 | 158 | protected function validateItemsAsArray($attribute, $items, $fail) |
159 | 159 | { |
160 | - if (! empty($this->namedItemRules)) { |
|
160 | + if (!empty($this->namedItemRules)) { |
|
161 | 161 | $this->validateNamedItemRules($attribute, $items, $fail); |
162 | 162 | } |
163 | 163 | |
@@ -207,11 +207,11 @@ discard block |
||
207 | 207 | */ |
208 | 208 | private function validateNamedItemRules($attribute, $items, $fail) |
209 | 209 | { |
210 | - $this->namedItemRules = array_combine(array_map(function ($ruleKey) use ($attribute) { |
|
210 | + $this->namedItemRules = array_combine(array_map(function($ruleKey) use ($attribute) { |
|
211 | 211 | return $attribute.'.*.'.$ruleKey; |
212 | 212 | }, array_keys($this->namedItemRules)), $this->namedItemRules); |
213 | 213 | |
214 | - array_walk($this->namedItemRules, function (&$value, $key) { |
|
214 | + array_walk($this->namedItemRules, function(&$value, $key) { |
|
215 | 215 | if (is_array($value)) { |
216 | 216 | $rules = []; |
217 | 217 | foreach ($value as $rule) { |