@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | * |
54 | 54 | * @return ResponseInterface |
55 | 55 | */ |
56 | - public function redirectUrl(UriInterface|string $url, int $code = StatusCodeInterface::STATUS_FOUND): ResponseInterface; |
|
56 | + public function redirectUrl(UriInterface | string $url, int $code = StatusCodeInterface::STATUS_FOUND): ResponseInterface; |
|
57 | 57 | |
58 | 58 | /** |
59 | 59 | * @param string|array<mixed>|object $content |
@@ -62,7 +62,7 @@ discard block |
||
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. |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | * |
86 | 86 | * @return ResponseInterface |
87 | 87 | */ |
88 | - public function redirectUrl(UriInterface|string $url, int $code = StatusCodeInterface::STATUS_FOUND): ResponseInterface |
|
88 | + public function redirectUrl(UriInterface | string $url, int $code = StatusCodeInterface::STATUS_FOUND): ResponseInterface |
|
89 | 89 | { |
90 | 90 | return $this->response_factory |
91 | 91 | ->createResponse($code) |
@@ -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 |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | } |
158 | 158 | } |
159 | 159 | |
160 | - if ($values[$i] !== '' || $children_with_values && !$element instanceof AbstractXrefElement) { |
|
160 | + if ($values[$i] !== '' || $children_with_values && !$element instanceof AbstractXrefElement) { |
|
161 | 161 | if ($values[$i] === '') { |
162 | 162 | $gedcom_lines[] = $levels[$i] . ' ' . $tags[$i]; |
163 | 163 | } else { |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | * |
232 | 232 | * @return array<string> |
233 | 233 | */ |
234 | - public function factsToAdd(Family|Individual $record, bool $include_hidden): array |
|
234 | + public function factsToAdd(Family | Individual $record, bool $include_hidden): array |
|
235 | 235 | { |
236 | 236 | $subtags = Registry::elementFactory()->make($record->tag())->subtags(); |
237 | 237 |
@@ -114,7 +114,7 @@ |
||
114 | 114 | * |
115 | 115 | * @return ResponseInterface |
116 | 116 | */ |
117 | -function response(array|object|string $content = '', int $code = StatusCodeInterface::STATUS_OK, array $headers = []): ResponseInterface |
|
117 | +function response(array | object | string $content = '', int $code = StatusCodeInterface::STATUS_OK, array $headers = []): ResponseInterface |
|
118 | 118 | { |
119 | 119 | return Registry::responseFactory()->response($content, $code, $headers); |
120 | 120 | } |
@@ -301,7 +301,7 @@ |
||
301 | 301 | { |
302 | 302 | $latest_version = $this->fetchLatestVersion(false); |
303 | 303 | |
304 | - [, , $url] = explode('|', $latest_version . '||'); |
|
304 | + [,, $url] = explode('|', $latest_version . '||'); |
|
305 | 305 | |
306 | 306 | return $url; |
307 | 307 | } |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | */ |
126 | 126 | public function isBetween(int $minimum, int $maximum): self |
127 | 127 | { |
128 | - $this->rules[] = static function (?int $value) use ($minimum, $maximum): ?int { |
|
128 | + $this->rules[] = static function (?int $value) use ($minimum, $maximum) : ?int { |
|
129 | 129 | if (is_int($value) && $value >= $minimum && $value <= $maximum) { |
130 | 130 | return $value; |
131 | 131 | } |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | */ |
144 | 144 | public function isInArray(array $values): self |
145 | 145 | { |
146 | - $this->rules[] = static fn (int|string|null $value): int|string|null => in_array($value, $values, true) ? $value : null; |
|
146 | + $this->rules[] = static fn (int | string | null $value): int | string | null => in_array($value, $values, true) ? $value : null; |
|
147 | 147 | |
148 | 148 | return $this; |
149 | 149 | } |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | */ |
164 | 164 | public function isNotEmpty(): self |
165 | 165 | { |
166 | - $this->rules[] = static fn (?string $value): ?string => $value !== null && $value !== '' ? $value : null; |
|
166 | + $this->rules[] = static fn (?string $value) : ?string => $value !== null && $value !== '' ? $value : null; |
|
167 | 167 | |
168 | 168 | return $this; |
169 | 169 | } |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | { |
176 | 176 | $base_url = $this->request->getAttribute('base_url', ''); |
177 | 177 | |
178 | - $this->rules[] = static function (?string $value) use ($base_url): ?string { |
|
178 | + $this->rules[] = static function (?string $value) use ($base_url) : ?string { |
|
179 | 179 | if ($value !== null) { |
180 | 180 | $value_info = parse_url($value); |
181 | 181 | $base_url_info = parse_url($base_url); |
@@ -279,7 +279,7 @@ discard block |
||
279 | 279 | throw new HttpBadRequestException(I18N::translate('The parameter ā%sā is missing.', $parameter)); |
280 | 280 | } |
281 | 281 | |
282 | - $callback = static fn (?array $value, Closure $rule): ?array => $rule($value); |
|
282 | + $callback = static fn (?array $value, Closure $rule) : ?array => $rule($value); |
|
283 | 283 | |
284 | 284 | return array_reduce($this->rules, $callback, $value) ?? []; |
285 | 285 | } |
@@ -306,7 +306,7 @@ discard block |
||
306 | 306 | $value = null; |
307 | 307 | } |
308 | 308 | |
309 | - $callback = static fn (?int $value, Closure $rule): ?int => $rule($value); |
|
309 | + $callback = static fn (?int $value, Closure $rule) : ?int => $rule($value); |
|
310 | 310 | |
311 | 311 | $value = array_reduce($this->rules, $callback, $value) ?? $default; |
312 | 312 | |
@@ -347,9 +347,9 @@ discard block |
||
347 | 347 | $value = null; |
348 | 348 | } |
349 | 349 | |
350 | - $callback = static fn (?string $value, Closure $rule): ?string => $rule($value); |
|
350 | + $callback = static fn (?string $value, Closure $rule) : ?string => $rule($value); |
|
351 | 351 | |
352 | - $value = array_reduce($this->rules, $callback, $value) ?? $default; |
|
352 | + $value = array_reduce($this->rules, $callback, $value) ?? $default; |
|
353 | 353 | |
354 | 354 | if ($value === null) { |
355 | 355 | throw new HttpBadRequestException(I18N::translate('The parameter ā%sā is missing.', $parameter)); |
@@ -232,7 +232,7 @@ |
||
232 | 232 | ->orderBy('d_type') |
233 | 233 | ->limit(1) |
234 | 234 | ->get() |
235 | - ->map(static fn (object $row): object => (object) [ |
|
235 | + ->map(static fn (object $row) : object => (object) [ |
|
236 | 236 | 'id' => $row->id, |
237 | 237 | 'year' => (int) $row->year, |
238 | 238 | 'fact' => $row->fact, |
@@ -1070,7 +1070,7 @@ |
||
1070 | 1070 | * @param Expression|string $column |
1071 | 1071 | * @param array<string> $search_terms |
1072 | 1072 | */ |
1073 | - private function whereSearch(Builder $query, Expression|string $column, array $search_terms): void |
|
1073 | + private function whereSearch(Builder $query, Expression | string $column, array $search_terms): void |
|
1074 | 1074 | { |
1075 | 1075 | foreach ($search_terms as $search_term) { |
1076 | 1076 | $query->where($column, $this->iLike(), '%' . addcslashes($search_term, '\\%_') . '%'); |