@@ -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 |
@@ -117,7 +117,7 @@ |
||
117 | 117 | } |
118 | 118 | |
119 | 119 | /** |
120 | - * @param array<Fillable&Element> $elements |
|
120 | + * @param array<Fillable&Element> $elements |
|
121 | 121 | * @return Fillable |
122 | 122 | */ |
123 | 123 | public function addElements(array $elements): Fillable |
@@ -54,7 +54,7 @@ |
||
54 | 54 | * Из-за того что php преобразует строки, содержащие целое число к int, приходится добавлять |
55 | 55 | * пробел либо в начало, либо в конец ключа. В итоге пробелы в начале и в конце удаляются автоматически. |
56 | 56 | */ |
57 | - public function fill(array|Closure $data, bool $useTitleAsValue = false): Fillable |
|
57 | + public function fill(array | Closure $data, bool $useTitleAsValue = false): Fillable |
|
58 | 58 | { |
59 | 59 | if ($data instanceof Closure) { |
60 | 60 | /** @var mixed $data */ |
@@ -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->setAttribute(AttributeFactory::create('step', $step)); |
@@ -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->setAttribute(AttributeFactory::create('step', $step)); |
@@ -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|AttributeInterface $element): AttributeCollection |
|
58 | + public function remove(string | AttributeInterface $element): AttributeCollection |
|
59 | 59 | { |
60 | 60 | $attributeName = ($element instanceof AttributeInterface) ? $element->getName() : $element; |
61 | 61 |
@@ -52,6 +52,6 @@ |
||
52 | 52 | // $value = idn_to_ascii($value); |
53 | 53 | // } |
54 | 54 | |
55 | - return (bool)filter_var($value, \FILTER_VALIDATE_EMAIL); |
|
55 | + return (bool) filter_var($value, \FILTER_VALIDATE_EMAIL); |
|
56 | 56 | } |
57 | 57 | } |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | return $this->attributes[$namespace]; |
26 | 26 | } |
27 | 27 | |
28 | - public function getAttribute(string $name, string $namespace = 'general'): AttributeInterface|null |
|
28 | + public function getAttribute(string $name, string $namespace = 'general'): AttributeInterface | null |
|
29 | 29 | { |
30 | 30 | return $this->getAttributeCollection($namespace)->get($name); |
31 | 31 | } |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | */ |
114 | 114 | public function getAttributesString(string $namespace = 'general'): string |
115 | 115 | { |
116 | - $attributesStringed = (string)$this->getAttributeCollection($namespace); |
|
116 | + $attributesStringed = (string) $this->getAttributeCollection($namespace); |
|
117 | 117 | |
118 | 118 | if (empty($attributesStringed)) { |
119 | 119 | return ''; |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | * @return $this |
127 | 127 | * @noinspection PhpMissingReturnTypeInspection |
128 | 128 | */ |
129 | - public function removeAttribute(string|AttributeInterface $attribute, string $namespace = 'general') |
|
129 | + public function removeAttribute(string | AttributeInterface $attribute, string $namespace = 'general') |
|
130 | 130 | { |
131 | 131 | $this->getAttributeCollection($namespace)->remove($attribute); |
132 | 132 | return $this; |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | * @return Textarea |
48 | 48 | * @psalm-suppress RedundantConditionGivenDocblockType |
49 | 49 | */ |
50 | - public function setRows(int|Closure $rows): Textarea |
|
50 | + public function setRows(int | Closure $rows): Textarea |
|
51 | 51 | { |
52 | 52 | if ($rows instanceof Closure) { |
53 | 53 | $rows = $rows(); |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | * @return Textarea |
64 | 64 | * @psalm-suppress RedundantConditionGivenDocblockType |
65 | 65 | */ |
66 | - public function setCols(int|Closure $cols): Textarea |
|
66 | + public function setCols(int | Closure $cols): Textarea |
|
67 | 67 | { |
68 | 68 | if ($cols instanceof Closure) { |
69 | 69 | $cols = $cols(); |
@@ -165,7 +165,7 @@ |
||
165 | 165 | /** |
166 | 166 | * @throws InvalidArgumentException |
167 | 167 | */ |
168 | - private function normalize(float|bool|int|string|null $value): ?string |
|
168 | + private function normalize(float | bool | int | string | null $value): ?string |
|
169 | 169 | { |
170 | 170 | Assert::nullOrScalar($value); |
171 | 171 | return ($value === null) ? null : \htmlspecialchars((string) $value, ENT_QUOTES | ENT_SUBSTITUTE | ENT_HTML401); |