@@ -30,7 +30,7 @@ |
||
| 30 | 30 | /** |
| 31 | 31 | * @param string|null $message |
| 32 | 32 | */ |
| 33 | - public function __construct(string|null $message = null) |
|
| 33 | + public function __construct(string | null $message = null) |
|
| 34 | 34 | { |
| 35 | 35 | $message ??= I18N::translate('Too many requests. Try again later.'); |
| 36 | 36 | |
@@ -30,7 +30,7 @@ |
||
| 30 | 30 | /** |
| 31 | 31 | * @param string|null $message |
| 32 | 32 | */ |
| 33 | - public function __construct(string|null $message = null) |
|
| 33 | + public function __construct(string | null $message = null) |
|
| 34 | 34 | { |
| 35 | 35 | $message ??= I18N::translate('This page has been deleted.'); |
| 36 | 36 | |
@@ -30,7 +30,7 @@ |
||
| 30 | 30 | /** |
| 31 | 31 | * @param string|null $message |
| 32 | 32 | */ |
| 33 | - public function __construct(string|null $message = null) |
|
| 33 | + public function __construct(string | null $message = null) |
|
| 34 | 34 | { |
| 35 | 35 | $message ??= I18N::translate('The server could not understand this request.'); |
| 36 | 36 | |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | * |
| 99 | 99 | * @return string |
| 100 | 100 | */ |
| 101 | - public function display(Tree|null $tree = null, string|null $date_format = null, bool $convert_calendars = false): string |
|
| 101 | + public function display(Tree | null $tree = null, string | null $date_format = null, bool $convert_calendars = false): string |
|
| 102 | 102 | { |
| 103 | 103 | if ($tree instanceof Tree) { |
| 104 | 104 | $CALENDAR_FORMAT = $tree->getPreference('CALENDAR_FORMAT'); |
@@ -303,7 +303,7 @@ discard block |
||
| 303 | 303 | public function addYears(int $years, string $qualifier = ''): Date |
| 304 | 304 | { |
| 305 | 305 | $tmp = clone $this; |
| 306 | - $tmp->date1->year += $years; |
|
| 306 | + $tmp->date1->year += $years; |
|
| 307 | 307 | $tmp->date1->month = 0; |
| 308 | 308 | $tmp->date1->day = 0; |
| 309 | 309 | $tmp->date1->setJdFromYmd(); |
@@ -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); |
@@ -247,7 +247,7 @@ discard block |
||
| 247 | 247 | * |
| 248 | 248 | * @return bool |
| 249 | 249 | */ |
| 250 | - public function boolean(string $parameter, bool|null $default = null): bool |
|
| 250 | + public function boolean(string $parameter, bool | null $default = null): bool |
|
| 251 | 251 | { |
| 252 | 252 | $value = $this->parameters[$parameter] ?? null; |
| 253 | 253 | |
@@ -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 | } |
@@ -290,7 +290,7 @@ discard block |
||
| 290 | 290 | * |
| 291 | 291 | * @return float |
| 292 | 292 | */ |
| 293 | - public function float(string $parameter, float|null $default = null): float |
|
| 293 | + public function float(string $parameter, float | null $default = null): float |
|
| 294 | 294 | { |
| 295 | 295 | $value = $this->parameters[$parameter] ?? null; |
| 296 | 296 | |
@@ -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 | |
@@ -317,7 +317,7 @@ discard block |
||
| 317 | 317 | * |
| 318 | 318 | * @return int |
| 319 | 319 | */ |
| 320 | - public function integer(string $parameter, int|null $default = null): int |
|
| 320 | + public function integer(string $parameter, int | null $default = null): int |
|
| 321 | 321 | { |
| 322 | 322 | $value = $this->parameters[$parameter] ?? null; |
| 323 | 323 | |
@@ -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 | |
@@ -366,7 +366,7 @@ discard block |
||
| 366 | 366 | * |
| 367 | 367 | * @return string |
| 368 | 368 | */ |
| 369 | - public function string(string $parameter, string|null $default = null): string |
|
| 369 | + public function string(string $parameter, string | null $default = null): string |
|
| 370 | 370 | { |
| 371 | 371 | $value = $this->parameters[$parameter] ?? null; |
| 372 | 372 | |
@@ -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)); |
@@ -243,7 +243,7 @@ discard block |
||
| 243 | 243 | * |
| 244 | 244 | * @return bool |
| 245 | 245 | */ |
| 246 | - public function canShow(int|null $access_level = null): bool |
|
| 246 | + public function canShow(int | null $access_level = null): bool |
|
| 247 | 247 | { |
| 248 | 248 | $access_level ??= Auth::accessLevel($this->tree); |
| 249 | 249 | |
@@ -267,7 +267,7 @@ discard block |
||
| 267 | 267 | * |
| 268 | 268 | * @return bool |
| 269 | 269 | */ |
| 270 | - public function canShowName(int|null $access_level = null): bool |
|
| 270 | + public function canShowName(int | null $access_level = null): bool |
|
| 271 | 271 | { |
| 272 | 272 | return $this->canShow($access_level); |
| 273 | 273 | } |
@@ -429,7 +429,7 @@ discard block |
||
| 429 | 429 | * |
| 430 | 430 | * @return void |
| 431 | 431 | */ |
| 432 | - public function setPrimaryName(int|null $n = null): void |
|
| 432 | + public function setPrimaryName(int | null $n = null): void |
|
| 433 | 433 | { |
| 434 | 434 | $this->getPrimaryName = $n; |
| 435 | 435 | $this->getSecondaryName = null; |
@@ -608,7 +608,7 @@ discard block |
||
| 608 | 608 | public function facts( |
| 609 | 609 | array $filter = [], |
| 610 | 610 | bool $sort = false, |
| 611 | - int|null $access_level = null, |
|
| 611 | + int | null $access_level = null, |
|
| 612 | 612 | bool $ignore_deleted = false |
| 613 | 613 | ): Collection { |
| 614 | 614 | $access_level ??= Auth::accessLevel($this->tree); |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | * |
| 56 | 56 | * @return bool |
| 57 | 57 | */ |
| 58 | - public static function isAdmin(UserInterface|null $user = null): bool |
|
| 58 | + public static function isAdmin(UserInterface | null $user = null): bool |
|
| 59 | 59 | { |
| 60 | 60 | $user ??= self::user(); |
| 61 | 61 | |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | * |
| 71 | 71 | * @return bool |
| 72 | 72 | */ |
| 73 | - public static function isManager(Tree $tree, UserInterface|null $user = null): bool |
|
| 73 | + public static function isManager(Tree $tree, UserInterface | null $user = null): bool |
|
| 74 | 74 | { |
| 75 | 75 | $user ??= self::user(); |
| 76 | 76 | |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | * |
| 86 | 86 | * @return bool |
| 87 | 87 | */ |
| 88 | - public static function isModerator(Tree $tree, UserInterface|null $user = null): bool |
|
| 88 | + public static function isModerator(Tree $tree, UserInterface | null $user = null): bool |
|
| 89 | 89 | { |
| 90 | 90 | $user ??= self::user(); |
| 91 | 91 | |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | * |
| 103 | 103 | * @return bool |
| 104 | 104 | */ |
| 105 | - public static function isEditor(Tree $tree, UserInterface|null $user = null): bool |
|
| 105 | + public static function isEditor(Tree $tree, UserInterface | null $user = null): bool |
|
| 106 | 106 | { |
| 107 | 107 | $user ??= self::user(); |
| 108 | 108 | |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | * |
| 120 | 120 | * @return bool |
| 121 | 121 | */ |
| 122 | - public static function isMember(Tree $tree, UserInterface|null $user = null): bool |
|
| 122 | + public static function isMember(Tree $tree, UserInterface | null $user = null): bool |
|
| 123 | 123 | { |
| 124 | 124 | $user ??= self::user(); |
| 125 | 125 | |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | * |
| 137 | 137 | * @return int |
| 138 | 138 | */ |
| 139 | - public static function accessLevel(Tree $tree, UserInterface|null $user = null): int |
|
| 139 | + public static function accessLevel(Tree $tree, UserInterface | null $user = null): int |
|
| 140 | 140 | { |
| 141 | 141 | $user ??= self::user(); |
| 142 | 142 | |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | * |
| 56 | 56 | * @return void |
| 57 | 57 | */ |
| 58 | - private static function addLog(string $message, string $log_type, Tree|null $tree = null): void |
|
| 58 | + private static function addLog(string $message, string $log_type, Tree | null $tree = null): void |
|
| 59 | 59 | { |
| 60 | 60 | if (Registry::container()->has(ServerRequestInterface::class)) { |
| 61 | 61 | $request = Registry::container()->get(ServerRequestInterface::class); |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | * |
| 82 | 82 | * @return void |
| 83 | 83 | */ |
| 84 | - public static function addConfigurationLog(string $message, Tree|null $tree = null): void |
|
| 84 | + public static function addConfigurationLog(string $message, Tree | null $tree = null): void |
|
| 85 | 85 | { |
| 86 | 86 | self::addLog($message, self::TYPE_CONFIGURATION, $tree); |
| 87 | 87 | } |
@@ -378,7 +378,7 @@ |
||
| 378 | 378 | * |
| 379 | 379 | * @return string |
| 380 | 380 | */ |
| 381 | - private function getDescendantsHtml(Tree $tree, array $individuals, array $ancestors, string $surname, bool $soundex_dm, bool $soundex_std, Individual $individual, Family|null $parents = null): string |
|
| 381 | + private function getDescendantsHtml(Tree $tree, array $individuals, array $ancestors, string $surname, bool $soundex_dm, bool $soundex_std, Individual $individual, Family | null $parents = null): string |
|
| 382 | 382 | { |
| 383 | 383 | $module = $this->module_service->findByComponent(ModuleChartInterface::class, $tree, Auth::user())->first(static function (ModuleInterface $module) { |
| 384 | 384 | return $module instanceof RelationshipsChartModule; |