We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -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 | |
@@ -212,13 +212,13 @@ discard block |
||
| 212 | 212 | }, array_keys($this->namedItemRules)), $this->namedItemRules); |
| 213 | 213 | |
| 214 | 214 | array_walk($this->namedItemRules, function(&$value, $key) { |
| 215 | - if(is_array($value)) { |
|
| 215 | + if (is_array($value)) { |
|
| 216 | 216 | $rules = []; |
| 217 | - foreach($value as $rule) { |
|
| 217 | + foreach ($value as $rule) { |
|
| 218 | 218 | if (is_a($rule, get_class($this), true)) { |
| 219 | - $validArrayRules = $rule->itemRules; |
|
| 220 | - if(is_array($validArrayRules)) { |
|
| 221 | - foreach($validArrayRules as $validArrayRule) { |
|
| 219 | + $validArrayRules = $rule->itemRules; |
|
| 220 | + if (is_array($validArrayRules)) { |
|
| 221 | + foreach ($validArrayRules as $validArrayRule) { |
|
| 222 | 222 | // dd($validArrayRule); |
| 223 | 223 | } |
| 224 | 224 | $rules = array_merge($rules, $validArrayRules); |
@@ -239,7 +239,7 @@ discard block |
||
| 239 | 239 | public function __call($method, $arguments) |
| 240 | 240 | { |
| 241 | 241 | // if method starts with `rule` eg: ruleName, extract the input name and add it to the array of rules |
| 242 | - if(Str::startsWith($method, 'rule')) { |
|
| 242 | + if (Str::startsWith($method, 'rule')) { |
|
| 243 | 243 | $argument = Str::snake(Str::replaceFirst('rule', '', $method)); |
| 244 | 244 | $this->namedItemRules[$argument] = $arguments[0]; |
| 245 | 245 | return $this; |