We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | { |
13 | 13 | private Collection $attributes; |
14 | 14 | |
15 | - public function __construct(array|string $initAttributes, |
|
15 | + public function __construct(array | string $initAttributes, |
|
16 | 16 | array $componentAttributes = [], |
17 | 17 | array $rules = [], |
18 | 18 | array $defaults = [], |
@@ -32,17 +32,17 @@ discard block |
||
32 | 32 | } |
33 | 33 | } |
34 | 34 | |
35 | - private function buildAttributes(array|string $attributes, $componentAttributes) |
|
35 | + private function buildAttributes(array | string $attributes, $componentAttributes) |
|
36 | 36 | { |
37 | 37 | if (is_string($attributes)) { |
38 | 38 | $attributes = ['name' => $attributes]; |
39 | 39 | } |
40 | 40 | |
41 | - $attributeNames = collect($componentAttributes)->mapWithKeys(function ($attribute) { |
|
41 | + $attributeNames = collect($componentAttributes)->mapWithKeys(function($attribute) { |
|
42 | 42 | return [$attribute::getAttributeName() => $attribute]; |
43 | 43 | })->toArray(); |
44 | 44 | |
45 | - return collect($attributes)->mapWithKeys(function ($value, $key) use ($attributeNames) { |
|
45 | + return collect($attributes)->mapWithKeys(function($value, $key) use ($attributeNames) { |
|
46 | 46 | if (isset($attributeNames[$key])) { |
47 | 47 | return [$key => $attributeNames[$key]::make($key, $value, $attributeNames[$key]::getValidationRules($this))]; |
48 | 48 | } |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | |
71 | 71 | public function getItemByName(string $name) |
72 | 72 | { |
73 | - return $this->getItems()->first(function ($item, $key) use ($name) { |
|
73 | + return $this->getItems()->first(function($item, $key) use ($name) { |
|
74 | 74 | return $key === $name; |
75 | 75 | }); |
76 | 76 | } |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | |
133 | 133 | public function toCollection(): Collection |
134 | 134 | { |
135 | - return $this->attributes->mapWithKeys(function ($item, $key) { |
|
135 | + return $this->attributes->mapWithKeys(function($item, $key) { |
|
136 | 136 | return [$key => $item->value()]; |
137 | 137 | }); |
138 | 138 | } |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | private function setAttributeDefaults($componentAttributes) |
146 | 146 | { |
147 | 147 | foreach ($componentAttributes as $attribute) { |
148 | - if (! $this->hasAttribute($attribute::getAttributeName())) { |
|
148 | + if (!$this->hasAttribute($attribute::getAttributeName())) { |
|
149 | 149 | $this->attributes[$attribute::getAttributeName()] = $attribute::make($attribute::getAttributeName(), $attribute::getDefault($this), $attribute::getValidationRules($this)); |
150 | 150 | } |
151 | 151 | } |
@@ -16,13 +16,13 @@ |
||
16 | 16 | { |
17 | 17 | return [ |
18 | 18 | 'required', |
19 | - function ($attribute, $value, $fail) use ($attributes) { |
|
19 | + function($attribute, $value, $fail) use ($attributes) { |
|
20 | 20 | if ($attributes->hasAttribute('entity') && $attributes->getAttributeValue('entity')) { |
21 | - if (! is_string($value)) { |
|
21 | + if (!is_string($value)) { |
|
22 | 22 | $fail('The '.$attribute.' should be a valid model string.'); |
23 | 23 | } |
24 | 24 | |
25 | - if (! is_a($value, 'Illuminate\Database\Eloquent\Model', true)) { |
|
25 | + if (!is_a($value, 'Illuminate\Database\Eloquent\Model', true)) { |
|
26 | 26 | $fail('The '.$attribute.' should be a valid class that extends Illuminate\Database\Eloquent\Model .'); |
27 | 27 | } |
28 | 28 | } else { |