@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | * @param array|Closure():array $data |
| 103 | 103 | * @return $this |
| 104 | 104 | */ |
| 105 | - public function setDefaults(array|Closure $data): Form |
|
| 105 | + public function setDefaults(array | Closure $data): Form |
|
| 106 | 106 | { |
| 107 | 107 | |
| 108 | 108 | if ($this->submitted === true) { |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | 'POST' => $this->getRequest()->getPostData()->toArray(), |
| 113 | 113 | default => [], |
| 114 | 114 | }, |
| 115 | - function ($k) { |
|
| 115 | + function($k) { |
|
| 116 | 116 | return !in_array($k, [self::_TOKEN_CSRF_, self::_TOKEN_SUBMIT_]); |
| 117 | 117 | }, |
| 118 | 118 | ARRAY_FILTER_USE_KEY |
@@ -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 | |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | Rules::CALLBACK, |
| 33 | 33 | 'CSRF Attack detected', |
| 34 | 34 | [ |
| 35 | - function (string $key) { |
|
| 35 | + function(string $key) { |
|
| 36 | 36 | /** @psalm-suppress PossiblyNullArgument */ |
| 37 | 37 | if (password_verify($key, $this->getRequest()->getPostData(Form::_TOKEN_CSRF_, ''))) { |
| 38 | 38 | return true; |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | */ |
| 66 | 66 | private function getCsrfSecret(): string |
| 67 | 67 | { |
| 68 | - $secret = (string)$this->session->get('csrf_secret'); |
|
| 68 | + $secret = (string) $this->session->get('csrf_secret'); |
|
| 69 | 69 | |
| 70 | 70 | if (empty($secret)) { |
| 71 | 71 | $secret = $this->generateSecret(); |
@@ -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 | } |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | * @noinspection PhpMissingParamTypeInspection |
| 129 | 129 | * @noinspection PhpUnusedPrivateMethodInspection |
| 130 | 130 | */ |
| 131 | - private function checkMaxsize($value, int|array|string $ruleOpts, Ruleable $element): bool |
|
| 131 | + private function checkMaxsize($value, int | array | string $ruleOpts, Ruleable $element): bool |
|
| 132 | 132 | { |
| 133 | 133 | if ($value === false) { |
| 134 | 134 | return true; |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | * @noinspection PhpMissingParamTypeInspection |
| 161 | 161 | * @noinspection PhpUnusedPrivateMethodInspection |
| 162 | 162 | */ |
| 163 | - private function checkExtensions($value, string|array $ruleOpts, Ruleable $element): bool |
|
| 163 | + private function checkExtensions($value, string | array $ruleOpts, Ruleable $element): bool |
|
| 164 | 164 | { |
| 165 | 165 | if ($value === false) { |
| 166 | 166 | return true; |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | private function parseRuleOpts(mixed $opts): array |
| 190 | 190 | { |
| 191 | 191 | if (!is_array($opts)) { |
| 192 | - $opts = (array)$opts; |
|
| 192 | + $opts = (array) $opts; |
|
| 193 | 193 | $opts[1] = null; |
| 194 | 194 | } |
| 195 | 195 | list($param, $message) = $opts; |