@@ -228,7 +228,7 @@ |
||
| 228 | 228 | 'style' => Validator::parsedBody($request)->isInArrayKeys($this->styles())->integer('style'), |
| 229 | 229 | 'width' => Validator::parsedBody($request)->isBetween(self::MINIMUM_WIDTH, self::MAXIMUM_WIDTH)->integer('width'), |
| 230 | 230 | 'xref' => Validator::parsedBody($request)->isXref()->string('xref'), |
| 231 | - ])); |
|
| 231 | + ])); |
|
| 232 | 232 | } |
| 233 | 233 | |
| 234 | 234 | Auth::checkComponentAccess($this, ModuleChartInterface::class, $tree, $user); |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | */ |
| 104 | 104 | public function isBetween(int $minimum, int $maximum): self |
| 105 | 105 | { |
| 106 | - $this->rules[] = static function (?int $value) use ($minimum, $maximum): ?int { |
|
| 106 | + $this->rules[] = static function (?int $value) use ($minimum, $maximum) : ?int { |
|
| 107 | 107 | if (is_int($value) && $value >= $minimum && $value <= $maximum) { |
| 108 | 108 | return $value; |
| 109 | 109 | } |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | */ |
| 122 | 122 | public function isInArray(array $values): self |
| 123 | 123 | { |
| 124 | - $this->rules[] = static fn (/*int|string|null*/ $value)/*: int|string|null*/ => $value !== null && in_array($value, $values, true) ? $value : null; |
|
| 124 | + $this->rules[] = static fn(/*int|string|null*/ $value)/*: int|string|null*/ => $value !== null && in_array($value, $values, true) ? $value : null; |
|
| 125 | 125 | |
| 126 | 126 | return $this; |
| 127 | 127 | } |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | */ |
| 142 | 142 | public function isNotEmpty(): self |
| 143 | 143 | { |
| 144 | - $this->rules[] = static fn (?string $value): ?string => $value !== null && $value !== '' ? $value : null; |
|
| 144 | + $this->rules[] = static fn(?string $value) : ?string => $value !== null && $value !== '' ? $value : null; |
|
| 145 | 145 | |
| 146 | 146 | return $this; |
| 147 | 147 | } |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | */ |
| 154 | 154 | public function isLocalUrl(string $base_url): self |
| 155 | 155 | { |
| 156 | - $this->rules[] = static function (?string $value) use ($base_url): ?string { |
|
| 156 | + $this->rules[] = static function (?string $value) use ($base_url) : ?string { |
|
| 157 | 157 | if ($value !== null) { |
| 158 | 158 | $value_info = parse_url($value); |
| 159 | 159 | $base_url_info = parse_url($base_url); |
@@ -251,7 +251,7 @@ discard block |
||
| 251 | 251 | throw new HttpBadRequestException(I18N::translate('The parameter ā%sā is missing.', $parameter)); |
| 252 | 252 | } |
| 253 | 253 | |
| 254 | - $callback = static fn (?array $value, Closure $rule): ?array => $rule($value); |
|
| 254 | + $callback = static fn(?array $value, Closure $rule) : ?array => $rule($value); |
|
| 255 | 255 | |
| 256 | 256 | $value = array_reduce($this->rules, $callback, $value); |
| 257 | 257 | $value ??= []; |
@@ -283,7 +283,7 @@ discard block |
||
| 283 | 283 | $value = null; |
| 284 | 284 | } |
| 285 | 285 | |
| 286 | - $callback = static fn (?int $value, Closure $rule): ?int => $rule($value); |
|
| 286 | + $callback = static fn(?int $value, Closure $rule) : ?int => $rule($value); |
|
| 287 | 287 | |
| 288 | 288 | $value = array_reduce($this->rules, $callback, $value); |
| 289 | 289 | |
@@ -326,9 +326,9 @@ discard block |
||
| 326 | 326 | $value = null; |
| 327 | 327 | } |
| 328 | 328 | |
| 329 | - $callback = static fn (?string $value, Closure $rule): ?string => $rule($value); |
|
| 329 | + $callback = static fn(?string $value, Closure $rule) : ?string => $rule($value); |
|
| 330 | 330 | |
| 331 | - $value = array_reduce($this->rules, $callback, $value); |
|
| 331 | + $value = array_reduce($this->rules, $callback, $value); |
|
| 332 | 332 | $value ??= $default; |
| 333 | 333 | |
| 334 | 334 | if ($value === null || preg_match('//u', $value) !== 1) { |
@@ -69,10 +69,10 @@ |
||
| 69 | 69 | |
| 70 | 70 | // webtrees uses http_build_query() to generate URLs - which maps false onto "0". |
| 71 | 71 | // Aura uses rawurlencode(), which maps false onto "" - which does not work as an aura URL parameter. |
| 72 | - $parameters = array_map(static fn ($var) => is_bool($var) ? (int) $var : $var, $parameters); |
|
| 72 | + $parameters = array_map(static fn($var) => is_bool($var) ? (int) $var : $var, $parameters); |
|
| 73 | 73 | |
| 74 | 74 | // Aura doesn't work with empty/optional parameters. |
| 75 | - $parameters = array_map(static fn ($var) => $var === '' ? null : $var, $parameters); |
|
| 75 | + $parameters = array_map(static fn($var) => $var === '' ? null : $var, $parameters); |
|
| 76 | 76 | |
| 77 | 77 | $url = $router_container->getGenerator()->generate($route_name, $parameters); |
| 78 | 78 | |