We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -9,7 +9,7 @@ |
||
9 | 9 | */ |
10 | 10 | class TextField extends BaseField |
11 | 11 | { |
12 | - public function __construct(string|array $attributes) |
|
12 | + public function __construct(string | array $attributes) |
|
13 | 13 | { |
14 | 14 | parent::__construct($attributes); |
15 | 15 | $this->attributes->setAttribute('type', 'text'); |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | |
9 | 9 | class SelectFromModel extends BaseField |
10 | 10 | { |
11 | - public function __construct(string|array $attributes) |
|
11 | + public function __construct(string | array $attributes) |
|
12 | 12 | { |
13 | 13 | parent::__construct($attributes); |
14 | 14 | $this->attributes->setAttribute('type', 'select_from_model'); |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | { |
31 | 31 | return [ |
32 | 32 | Entity::class, |
33 | - 'model' => function ($attributes) { |
|
33 | + 'model' => function($attributes) { |
|
34 | 34 | return app('crud')->inferModelFromRelationship($attributes->toArray()); |
35 | 35 | }, |
36 | 36 | ]; |
@@ -75,7 +75,7 @@ |
||
75 | 75 | } |
76 | 76 | |
77 | 77 | // relationships are always public methods. |
78 | - if (! $methodReflection->isPublic()) { |
|
78 | + if (!$methodReflection->isPublic()) { |
|
79 | 79 | return false; |
80 | 80 | } |
81 | 81 |
@@ -17,9 +17,9 @@ |
||
17 | 17 | public static function getValidationRules(SmartCollectionInterface $attributes): array |
18 | 18 | { |
19 | 19 | return [ |
20 | - function ($attribute, $value, $fail) use ($attributes) { |
|
20 | + function($attribute, $value, $fail) use ($attributes) { |
|
21 | 21 | if ($attributes->hasAttribute('entity') && $attributes->getAttributeValue('entity')) { |
22 | - if (! is_string($value)) { |
|
22 | + if (!is_string($value)) { |
|
23 | 23 | $fail('The '.$attribute.' should be a valid relation type string.'); |
24 | 24 | } |
25 | 25 | } |
@@ -6,7 +6,7 @@ |
||
6 | 6 | |
7 | 7 | interface SmartCollectionInterface |
8 | 8 | { |
9 | - public function __construct(array|string $initAttributes, array $componentAttributes, array $rules = [], array $defaults = [], array $blocked = []); |
|
9 | + public function __construct(array | string $initAttributes, array $componentAttributes, array $rules = [], array $defaults = [], array $blocked = []); |
|
10 | 10 | |
11 | 11 | public function getItemByName(string $name); |
12 | 12 |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | */ |
8 | 8 | class Page |
9 | 9 | { |
10 | - public static function button(string|array $name) |
|
10 | + public static function button(string | array $name) |
|
11 | 11 | { |
12 | 12 | } |
13 | 13 | |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | * @param string|array $input |
18 | 18 | * @return Field |
19 | 19 | */ |
20 | - public static function field(string|array $input) |
|
20 | + public static function field(string | array $input) |
|
21 | 21 | { |
22 | 22 | return new BaseField($input); |
23 | 23 | } |
@@ -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 { |
@@ -4,7 +4,7 @@ |
||
4 | 4 | |
5 | 5 | interface SmartComponentInterface |
6 | 6 | { |
7 | - public static function make(string|array $name): SmartComponentInterface; |
|
7 | + public static function make(string | array $name): SmartComponentInterface; |
|
8 | 8 | |
9 | 9 | public static function makeOf(SmartCollectionInterface $attributes); |
10 | 10 |
@@ -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 | private array $componentAttributes = [], |
17 | 17 | private array $rules = [], |
18 | 18 | private array $defaults = [], |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | } |
27 | 27 | } |
28 | 28 | |
29 | - private function buildAttributes(array|string $attributes) |
|
29 | + private function buildAttributes(array | string $attributes) |
|
30 | 30 | { |
31 | 31 | if (is_string($attributes)) { |
32 | 32 | $attributes = ['name' => $attributes]; |
@@ -35,11 +35,11 @@ discard block |
||
35 | 35 | $rules = $this->rules; |
36 | 36 | $defaults = $this->defaults; |
37 | 37 | |
38 | - $attributeNames = collect($this->componentAttributes)->mapWithKeys(function ($attribute) { |
|
38 | + $attributeNames = collect($this->componentAttributes)->mapWithKeys(function($attribute) { |
|
39 | 39 | return [$attribute::getAttributeName() => $attribute]; |
40 | 40 | })->toArray(); |
41 | 41 | |
42 | - $attributeRules = collect($rules)->mapWithKeys(function ($rule) { |
|
42 | + $attributeRules = collect($rules)->mapWithKeys(function($rule) { |
|
43 | 43 | if (is_a($rule, SmartAttributeInterface::class, true)) { |
44 | 44 | return [$rule::getAttributeName() => $rule::getValidationRules($this)]; |
45 | 45 | } |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | return [$rule::getAttributeName() => $rule]; |
48 | 48 | })->toArray(); |
49 | 49 | |
50 | - $this->attributes = collect($attributes)->mapWithKeys(function ($value, $key) use ($attributeNames, $attributeRules, $defaults) { |
|
50 | + $this->attributes = collect($attributes)->mapWithKeys(function($value, $key) use ($attributeNames, $attributeRules, $defaults) { |
|
51 | 51 | if (isset($attributeNames[$key])) { |
52 | 52 | return [$key => $attributeNames[$key]::make($key, $value, $attributeNames[$key]::getValidationRules($this))]; |
53 | 53 | } |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | |
80 | 80 | public function getItemByName(string $name) |
81 | 81 | { |
82 | - return $this->getItems()->first(function ($item, $key) use ($name) { |
|
82 | + return $this->getItems()->first(function($item, $key) use ($name) { |
|
83 | 83 | return $key === $name; |
84 | 84 | }); |
85 | 85 | } |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | |
142 | 142 | public function toCollection(): Collection |
143 | 143 | { |
144 | - return $this->attributes->mapWithKeys(function ($item, $key) { |
|
144 | + return $this->attributes->mapWithKeys(function($item, $key) { |
|
145 | 145 | return [$key => $item->value()]; |
146 | 146 | }); |
147 | 147 | } |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | private function setAttributeDefaults() |
155 | 155 | { |
156 | 156 | foreach ($this->componentAttributes as $attribute) { |
157 | - if (! $this->hasAttribute($attribute::getAttributeName())) { |
|
157 | + if (!$this->hasAttribute($attribute::getAttributeName())) { |
|
158 | 158 | $this->attributes[$attribute::getAttributeName()] = $attribute::make($attribute::getAttributeName(), $attribute::getDefault($this), $attribute::getValidationRules($this)); |
159 | 159 | } |
160 | 160 | } |