@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | return $this; |
41 | 41 | } |
42 | 42 | |
43 | - public function get(string $name): AttributeInterface|null |
|
43 | + public function get(string $name): AttributeInterface | null |
|
44 | 44 | { |
45 | 45 | foreach ($this->collection as $item) { |
46 | 46 | if ($item->getName() === $name) { |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | $this->collection = []; |
56 | 56 | } |
57 | 57 | |
58 | - public function remove(string|Attribute $element): AttributeCollection |
|
58 | + public function remove(string | Attribute $element): AttributeCollection |
|
59 | 59 | { |
60 | 60 | $attributeName = ($element instanceof AttributeInterface) ? $element->getName() : $element; |
61 | 61 | |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | { |
81 | 81 | return implode( |
82 | 82 | ' ', |
83 | - array_filter($this->collection, function ($item) { |
|
83 | + array_filter($this->collection, function($item) { |
|
84 | 84 | return !empty($item->__toString()); |
85 | 85 | }) |
86 | 86 | ); |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | |
20 | 20 | protected string $type = 'range'; |
21 | 21 | |
22 | - public function setMin(string|int $min): self |
|
22 | + public function setMin(string | int $min): self |
|
23 | 23 | { |
24 | 24 | Assert::numeric($min); |
25 | 25 | $min = (int) $min; |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | } |
29 | 29 | |
30 | 30 | |
31 | - public function setMax(int|string $max): self |
|
31 | + public function setMax(int | string $max): self |
|
32 | 32 | { |
33 | 33 | Assert::numeric($max); |
34 | 34 | $max = (int) $max; |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | * @param numeric $step |
42 | 42 | * @return $this |
43 | 43 | */ |
44 | - public function setStep(float|int|string $step): self |
|
44 | + public function setStep(float | int | string $step): self |
|
45 | 45 | { |
46 | 46 | Assert::numeric($step); |
47 | 47 | $this->setAttr(AttributeFactory::create('step', $step)); |
@@ -32,7 +32,7 @@ |
||
32 | 32 | Rules::CALLBACK, |
33 | 33 | 'CSRF Attack detected', |
34 | 34 | [ |
35 | - function (string $key) { |
|
35 | + function(string $key) { |
|
36 | 36 | if (password_verify($key, $this->getRequest()->getPostData(Form::_TOKEN_CSRF_, ''))) { |
37 | 37 | return true; |
38 | 38 | } |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | protected string $type = 'number'; |
21 | 21 | |
22 | 22 | |
23 | - public function setMin(string|int $min): self |
|
23 | + public function setMin(string | int $min): self |
|
24 | 24 | { |
25 | 25 | Assert::numeric($min); |
26 | 26 | $min = (int) $min; |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | } |
30 | 30 | |
31 | 31 | |
32 | - public function setMax(int|string $max): self |
|
32 | + public function setMax(int | string $max): self |
|
33 | 33 | { |
34 | 34 | Assert::numeric($max); |
35 | 35 | $max = (int) $max; |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | * @param numeric $step |
43 | 43 | * @return $this |
44 | 44 | */ |
45 | - public function setStep(float|int|string $step): self |
|
45 | + public function setStep(float | int | string $step): self |
|
46 | 46 | { |
47 | 47 | Assert::numeric($step); |
48 | 48 | $this->setAttr(AttributeFactory::create('step', $step)); |
@@ -22,14 +22,14 @@ discard block |
||
22 | 22 | public function __construct($value, $label, $useTitleAsValue = false) |
23 | 23 | { |
24 | 24 | if (is_array($label)) { |
25 | - $this->label = (string)($label[0] ?? null); |
|
25 | + $this->label = (string) ($label[0] ?? null); |
|
26 | 26 | |
27 | 27 | if (isset($label[1]) && is_array($label[1])) { |
28 | 28 | $this->attributes = $label[1]; |
29 | 29 | } |
30 | 30 | } |
31 | 31 | |
32 | - $this->label ??= (string)$label; |
|
32 | + $this->label ??= (string) $label; |
|
33 | 33 | |
34 | 34 | /** @since 2.4.0 */ |
35 | 35 | if (is_string($value)) { |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | |
55 | 55 | public function getValue(): ?string |
56 | 56 | { |
57 | - return (string)$this->value; |
|
57 | + return (string) $this->value; |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | public function getLabel(): ?string |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | } else { |
120 | 120 | $value = explode($this->separator, $value); |
121 | 121 | } |
122 | - foreach ((array)$value as $item) { |
|
122 | + foreach ((array) $value as $item) { |
|
123 | 123 | if (!$this->has($item)) { |
124 | 124 | $this->values[] = $item; |
125 | 125 | } |
@@ -154,6 +154,6 @@ discard block |
||
154 | 154 | |
155 | 155 | Assert::nullOrScalar($value); |
156 | 156 | |
157 | - return ($value === null) ? null : (string)$value; |
|
157 | + return ($value === null) ? null : (string) $value; |
|
158 | 158 | } |
159 | 159 | } |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | return $this->attr[$namespace]; |
24 | 24 | } |
25 | 25 | |
26 | - public function getAttr(string $name, string $namespace = 'general'): AttributeInterface|null |
|
26 | + public function getAttr(string $name, string $namespace = 'general'): AttributeInterface | null |
|
27 | 27 | { |
28 | 28 | return $this->getAttributeCollection($namespace)->get($name); |
29 | 29 | } |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | */ |
103 | 103 | public function getAttributesString(string $namespace = 'general'): string |
104 | 104 | { |
105 | - $attributesStringed = (string)$this->getAttributeCollection($namespace); |
|
105 | + $attributesStringed = (string) $this->getAttributeCollection($namespace); |
|
106 | 106 | |
107 | 107 | if (empty($attributesStringed)) { |
108 | 108 | return ''; |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | /** |
115 | 115 | * @return $this |
116 | 116 | */ |
117 | - public function removeAttr(string|AttributeInterface $attribute, string $namespace = 'general') |
|
117 | + public function removeAttr(string | AttributeInterface $attribute, string $namespace = 'general') |
|
118 | 118 | { |
119 | 119 | $this->getAttributeCollection($namespace)->remove($attribute); |
120 | 120 | return $this; |
@@ -21,18 +21,18 @@ |
||
21 | 21 | private static function getMappedClass(string $className): Closure |
22 | 22 | { |
23 | 23 | $mappedClasses = [ |
24 | - 'class' => function (): AttributeInterface { |
|
24 | + 'class' => function(): AttributeInterface { |
|
25 | 25 | return new Class_(); |
26 | 26 | }, |
27 | - 'id' => function (): AttributeInterface { |
|
27 | + 'id' => function(): AttributeInterface { |
|
28 | 28 | return new Id(); |
29 | 29 | }, |
30 | - 'action' => function (): AttributeInterface { |
|
30 | + 'action' => function(): AttributeInterface { |
|
31 | 31 | return new Action(); |
32 | 32 | }, |
33 | 33 | ]; |
34 | 34 | |
35 | - return $mappedClasses[strtolower($className)] ?? function (string $name): AttributeInterface { |
|
35 | + return $mappedClasses[strtolower($className)] ?? function(string $name): AttributeInterface { |
|
36 | 36 | return (new Base())->withName($name); |
37 | 37 | }; |
38 | 38 | } |
@@ -125,7 +125,7 @@ |
||
125 | 125 | $parsed = $this->parseRuleOpts($ruleOpts); |
126 | 126 | |
127 | 127 | $threshold_size = $parsed['param']; |
128 | - // Assert::in($threshold_size); |
|
128 | + // Assert::in($threshold_size); |
|
129 | 129 | |
130 | 130 | $message = $parsed['message']; |
131 | 131 |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | /** |
117 | 117 | * @param false|UploadedFileInterface $value |
118 | 118 | */ |
119 | - private function checkMaxsize($value, int|array|string $ruleOpts, Ruleable $element): bool |
|
119 | + private function checkMaxsize($value, int | array | string $ruleOpts, Ruleable $element): bool |
|
120 | 120 | { |
121 | 121 | if ($value === false) { |
122 | 122 | return true; |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | /** |
147 | 147 | * @param false|UploadedFileInterface $value |
148 | 148 | */ |
149 | - private function checkExtensions($value, string|array $ruleOpts, Ruleable $element): bool |
|
149 | + private function checkExtensions($value, string | array $ruleOpts, Ruleable $element): bool |
|
150 | 150 | { |
151 | 151 | if ($value === false) { |
152 | 152 | return true; |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | private function parseRuleOpts($opts): array |
176 | 176 | { |
177 | 177 | if (!is_array($opts)) { |
178 | - $opts = (array)$opts; |
|
178 | + $opts = (array) $opts; |
|
179 | 179 | $opts[1] = null; |
180 | 180 | } |
181 | 181 | list($param, $message) = $opts; |