@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | */ |
| 108 | 108 | public function isBetween(int $minimum, int $maximum): self |
| 109 | 109 | { |
| 110 | - $this->rules[] = static function (?int $value) use ($minimum, $maximum): ?int { |
|
| 110 | + $this->rules[] = static function (?int $value) use ($minimum, $maximum) : ?int { |
|
| 111 | 111 | if (is_int($value) && $value >= $minimum && $value <= $maximum) { |
| 112 | 112 | return $value; |
| 113 | 113 | } |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | */ |
| 146 | 146 | public function isNotEmpty(): self |
| 147 | 147 | { |
| 148 | - $this->rules[] = static fn (?string $value): ?string => $value !== null && $value !== '' ? $value : null; |
|
| 148 | + $this->rules[] = static fn (?string $value) : ?string => $value !== null && $value !== '' ? $value : null; |
|
| 149 | 149 | |
| 150 | 150 | return $this; |
| 151 | 151 | } |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | { |
| 158 | 158 | $base_url = $this->request->getAttribute('base_url', ''); |
| 159 | 159 | |
| 160 | - $this->rules[] = static function (?string $value) use ($base_url): ?string { |
|
| 160 | + $this->rules[] = static function (?string $value) use ($base_url) : ?string { |
|
| 161 | 161 | if ($value !== null) { |
| 162 | 162 | $value_info = parse_url($value); |
| 163 | 163 | $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) { |
@@ -144,8 +144,7 @@ |
||
| 144 | 144 | } |
| 145 | 145 | return $genitive( |
| 146 | 146 | $sex === 'F' ? |
| 147 | - 'cousine du ' . $down . '<sup>e</sup> au ' . $up . '<sup>e</sup> degré' : |
|
| 148 | - 'cousin du ' . $down . '<sup>e</sup> au ' . $up . '<sup>e</sup> degré', |
|
| 147 | + 'cousine du ' . $down . '<sup>e</sup> au ' . $up . '<sup>e</sup> degré' : 'cousin du ' . $down . '<sup>e</sup> au ' . $up . '<sup>e</sup> degré', |
|
| 149 | 148 | $sex === 'F' ? 'de la ' : 'du ' |
| 150 | 149 | ); |
| 151 | 150 | }; |
@@ -154,7 +154,7 @@ |
||
| 154 | 154 | } |
| 155 | 155 | } |
| 156 | 156 | |
| 157 | - if ($values[$i] !== '' || $children_with_values && !$element instanceof AbstractXrefElement) { |
|
| 157 | + if ($values[$i] !== '' || $children_with_values && !$element instanceof AbstractXrefElement) { |
|
| 158 | 158 | if ($values[$i] === '') { |
| 159 | 159 | $gedcom_lines[] = $levels[$i] . ' ' . $tags[$i]; |
| 160 | 160 | } else { |
@@ -62,7 +62,7 @@ |
||
| 62 | 62 | * |
| 63 | 63 | * @return ResponseInterface |
| 64 | 64 | */ |
| 65 | - public function response(string|array|object $content = '', int $code = StatusCodeInterface::STATUS_OK, array $headers = []): ResponseInterface; |
|
| 65 | + public function response(string | array | object $content = '', int $code = StatusCodeInterface::STATUS_OK, array $headers = []): ResponseInterface; |
|
| 66 | 66 | |
| 67 | 67 | /** |
| 68 | 68 | * Create and render a view, and embed it in an HTML page. |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | * |
| 110 | 110 | * @return array|bool|int|null|string |
| 111 | 111 | */ |
| 112 | - public static function get(string $name, array|bool|int|string $default = null) |
|
| 112 | + public static function get(string $name, array | bool | int | string $default = null) |
|
| 113 | 113 | { |
| 114 | 114 | return $_SESSION[$name] ?? $default; |
| 115 | 115 | } |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | * |
| 122 | 122 | * @return array|bool|int|null|string |
| 123 | 123 | */ |
| 124 | - public static function pull(string $name): array|bool|int|null|string |
|
| 124 | + public static function pull(string $name): array | bool | int | null | string |
|
| 125 | 125 | { |
| 126 | 126 | $value = self::get($name); |
| 127 | 127 | self::forget($name); |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | * |
| 166 | 166 | * @return void |
| 167 | 167 | */ |
| 168 | - public static function put(string $name, array|bool|int|null|string $value): void |
|
| 168 | + public static function put(string $name, array | bool | int | null | string $value): void |
|
| 169 | 169 | { |
| 170 | 170 | $_SESSION[$name] = $value; |
| 171 | 171 | } |
@@ -269,7 +269,7 @@ |
||
| 269 | 269 | * |
| 270 | 270 | * @return string |
| 271 | 271 | */ |
| 272 | - public static function digits(string|int $n): string |
|
| 272 | + public static function digits(string | int $n): string |
|
| 273 | 273 | { |
| 274 | 274 | return self::$locale->digits((string) $n); |
| 275 | 275 | } |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | * |
| 100 | 100 | * @return ResponseInterface |
| 101 | 101 | */ |
| 102 | - public function response(string|array|object$content = '', int $code = StatusCodeInterface::STATUS_OK, array $headers = []): ResponseInterface |
|
| 102 | + public function response(string | array | object$content = '', int $code = StatusCodeInterface::STATUS_OK, array $headers = []): ResponseInterface |
|
| 103 | 103 | { |
| 104 | 104 | if ($content === '' && $code === StatusCodeInterface::STATUS_OK) { |
| 105 | 105 | $code = StatusCodeInterface::STATUS_NO_CONTENT; |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | if (is_string($content)) { |
| 109 | 109 | $headers['content-type'] ??= 'text/html; charset=UTF-8'; |
| 110 | 110 | } else { |
| 111 | - $content = json_encode($content, JSON_THROW_ON_ERROR | JSON_UNESCAPED_UNICODE); |
|
| 111 | + $content = json_encode($content, JSON_THROW_ON_ERROR | JSON_UNESCAPED_UNICODE); |
|
| 112 | 112 | $headers['content-type'] ??= 'application/json'; |
| 113 | 113 | } |
| 114 | 114 | |