@@ -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 | } |
@@ -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, '\\%_') . '%'); |
@@ -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 | } |
@@ -300,7 +300,7 @@ discard block |
||
| 300 | 300 | $value = null; |
| 301 | 301 | } |
| 302 | 302 | |
| 303 | - $callback = static fn (?float $value, Closure $rule): ?float => $rule($value); |
|
| 303 | + $callback = static fn (?float $value, Closure $rule) : ?float => $rule($value); |
|
| 304 | 304 | |
| 305 | 305 | $value = array_reduce($this->rules, $callback, $value) ?? $default; |
| 306 | 306 | |
@@ -333,7 +333,7 @@ discard block |
||
| 333 | 333 | $value = null; |
| 334 | 334 | } |
| 335 | 335 | |
| 336 | - $callback = static fn (?int $value, Closure $rule): ?int => $rule($value); |
|
| 336 | + $callback = static fn (?int $value, Closure $rule) : ?int => $rule($value); |
|
| 337 | 337 | |
| 338 | 338 | $value = array_reduce($this->rules, $callback, $value) ?? $default; |
| 339 | 339 | |
@@ -374,9 +374,9 @@ discard block |
||
| 374 | 374 | $value = null; |
| 375 | 375 | } |
| 376 | 376 | |
| 377 | - $callback = static fn (?string $value, Closure $rule): ?string => $rule($value); |
|
| 377 | + $callback = static fn (?string $value, Closure $rule) : ?string => $rule($value); |
|
| 378 | 378 | |
| 379 | - $value = array_reduce($this->rules, $callback, $value) ?? $default; |
|
| 379 | + $value = array_reduce($this->rules, $callback, $value) ?? $default; |
|
| 380 | 380 | |
| 381 | 381 | if ($value === null) { |
| 382 | 382 | throw new HttpBadRequestException(I18N::translate('The parameter ā%sā is missing.', $parameter)); |
@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | $surname_initials = $this->surnameInitials($surname_data); |
| 217 | 217 | |
| 218 | 218 | // We've requested a surname that doesn't currently exist. |
| 219 | - if ($surname !== '' && !array_key_exists($surname, $all_surns)) { |
|
| 219 | + if ($surname !== '' && !array_key_exists($surname, $all_surns)) { |
|
| 220 | 220 | $message = I18N::translate('There are no individuals with the surname ā%sā', e($surname)); |
| 221 | 221 | FlashMessages::addMessage($message); |
| 222 | 222 | |
@@ -604,7 +604,7 @@ discard block |
||
| 604 | 604 | ->groupBy([$this->binaryColumn('n_givn')]); |
| 605 | 605 | |
| 606 | 606 | foreach ($query->get() as $row) { |
| 607 | - $initial = I18N::strtoupper(I18N::language()->initialLetter($row->n_givn)); |
|
| 607 | + $initial = I18N::strtoupper(I18N::language()->initialLetter($row->n_givn)); |
|
| 608 | 608 | $initials[$initial] ??= 0; |
| 609 | 609 | $initials[$initial] += (int) $row->count; |
| 610 | 610 | } |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | */ |
| 47 | 47 | public function make(int $timestamp, UserInterface $user = null): TimestampInterface |
| 48 | 48 | { |
| 49 | - $user ??= Auth::user(); |
|
| 49 | + $user ??= Auth::user(); |
|
| 50 | 50 | $timezone = $user->getPreference(UserInterface::PREF_TIME_ZONE, Site::getPreference('TIMEZONE')); |
| 51 | 51 | $locale = I18N::locale()->code(); |
| 52 | 52 | |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | public function fromString(?string $string, string $format = 'Y-m-d H:i:s', UserInterface $user = null): TimestampInterface |
| 66 | 66 | { |
| 67 | 67 | $string ??= date($format); |
| 68 | - $utc = new DateTimeZone('UTC'); |
|
| 68 | + $utc = new DateTimeZone('UTC'); |
|
| 69 | 69 | |
| 70 | 70 | return $this->fromZoneString($utc, $string, $format, $user); |
| 71 | 71 | } |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | */ |
| 82 | 82 | public function fromLocalString(string $string, string $format = 'Y-m-d H:i:s', UserInterface $user = null): TimestampInterface |
| 83 | 83 | { |
| 84 | - $user ??= Auth::user(); |
|
| 84 | + $user ??= Auth::user(); |
|
| 85 | 85 | $timezone = new DateTimeZone($user->getPreference(UserInterface::PREF_TIME_ZONE, Site::getPreference('TIMEZONE'))); |
| 86 | 86 | |
| 87 | 87 | return $this->fromZoneString($timezone, $string, $format, $user); |