@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | { |
| 33 | 33 | private ServerRequestInterface $request; |
| 34 | 34 | |
| 35 | - private object|null $row = null; |
|
| 35 | + private object | null $row = null; |
|
| 36 | 36 | |
| 37 | 37 | public function __construct(ServerRequestInterface $request) |
| 38 | 38 | { |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | |
| 90 | 90 | // Only update session once a minute to reduce contention on the session table. |
| 91 | 91 | if (date('Y-m-d H:i:s', time() - 60) > $this->row->session_time) { |
| 92 | - $updates['session_time'] = date('Y-m-d H:i:s'); |
|
| 92 | + $updates['session_time'] = date('Y-m-d H:i:s'); |
|
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | if ($updates !== []) { |
@@ -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|null $value) use ($minimum, $maximum): int|null { |
|
| 128 | + $this->rules[] = static function (int | null $value) use ($minimum, $maximum): int | null { |
|
| 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|null $value): string|null => $value !== null && $value !== '' ? $value : null; |
|
| 166 | + $this->rules[] = static fn (string | null $value): string | null => $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|null $value) use ($base_url): string|null { |
|
| 178 | + $this->rules[] = static function (string | null $value) use ($base_url): string | null { |
|
| 179 | 179 | if ($value !== null) { |
| 180 | 180 | $value_info = parse_url($value); |
| 181 | 181 | $base_url_info = parse_url($base_url); |
@@ -204,7 +204,7 @@ discard block |
||
| 204 | 204 | */ |
| 205 | 205 | public function isTag(): self |
| 206 | 206 | { |
| 207 | - $this->rules[] = static function (string|null $value): string|null { |
|
| 207 | + $this->rules[] = static function (string | null $value): string | null { |
|
| 208 | 208 | if ($value !== null && preg_match('/^' . Gedcom::REGEX_TAG . '$/', $value) === 1) { |
| 209 | 209 | return $value; |
| 210 | 210 | } |
@@ -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|null $value, Closure $rule): array|null => $rule($value); |
|
| 282 | + $callback = static fn (array | null $value, Closure $rule): array | null => $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|null $value, Closure $rule): float|null => $rule($value); |
|
| 303 | + $callback = static fn (float | null $value, Closure $rule): float | null => $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|null $value, Closure $rule): int|null => $rule($value); |
|
| 336 | + $callback = static fn (int | null $value, Closure $rule): int | null => $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|null $value, Closure $rule): string|null => $rule($value); |
|
| 377 | + $callback = static fn (string | null $value, Closure $rule): string | null => $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)); |
@@ -401,7 +401,7 @@ discard block |
||
| 401 | 401 | throw new HttpBadRequestException(I18N::translate('The parameter “%s” is missing.', $parameter)); |
| 402 | 402 | } |
| 403 | 403 | |
| 404 | - public function treeOptional(string $parameter = 'tree'): Tree|null |
|
| 404 | + public function treeOptional(string $parameter = 'tree'): Tree | null |
|
| 405 | 405 | { |
| 406 | 406 | $value = $this->parameters[$parameter] ?? null; |
| 407 | 407 | |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -return array ( |
|
| 3 | +return array( |
|
| 4 | 4 | ' but the details are unknown' => ' but the details are unknown', |
| 5 | 5 | '%H:%i:%s' => '%g:%i:%s %a', |
| 6 | 6 | '%j %F %Y' => '%F %j, %Y', |
@@ -81,10 +81,10 @@ |
||
| 81 | 81 | 'dbcert' => $this->stringOption(input: $input, name: 'dbcert'), |
| 82 | 82 | 'dbca' => $this->stringOption(input: $input, name: 'dbca'), |
| 83 | 83 | 'dbverify' => $this->boolOption(input: $input, name: 'dbverify') ? '1' : '0', |
| 84 | - 'tblpfx' => $this->stringOption(input: $input, name: 'tblpfx'), |
|
| 85 | - 'base_url' => rtrim(string: $this->stringOption(input: $input, name: 'base-url'), characters: '/'), |
|
| 86 | - 'rewrite_urls' => $this->boolOption(input: $input, name: 'rewrite-urls') ? '1' : '0', |
|
| 87 | - 'block_asn' => $this->stringOption(input: $input, name: 'block-asn'), |
|
| 84 | + 'tblpfx' => $this->stringOption(input : $input, name : 'tblpfx'), |
|
| 85 | + 'base_url' => rtrim(string : $this->stringOption(input : $input, name : 'base-url'), characters : '/'), |
|
| 86 | + 'rewrite_urls' => $this->boolOption(input : $input, name : 'rewrite-urls') ? '1' : '0', |
|
| 87 | + 'block_asn' => $this->stringOption(input : $input, name : 'block-asn'), |
|
| 88 | 88 | ]; |
| 89 | 89 | |
| 90 | 90 | foreach ($config as $key => $value) { |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | ->where('wife_name.n_type', '<>', '_MARNM'); |
| 127 | 127 | }); |
| 128 | 128 | |
| 129 | - $field = new Expression('COALESCE(' . DB::prefix('husb_name') . ".n_full, '') || COALESCE(" . DB::prefix('wife_name') . ".n_full, '')"); |
|
| 129 | + $field = new Expression('COALESCE(' . DB::prefix('husb_name') . ".n_full, '') || COALESCE(" . DB::prefix('wife_name') . ".n_full, '')"); |
|
| 130 | 130 | |
| 131 | 131 | $this->whereTrees($query, 'f_file', $trees); |
| 132 | 132 | $this->whereSearch($query, $field, $search); |
@@ -1068,7 +1068,7 @@ discard block |
||
| 1068 | 1068 | * @param Expression<string>|string $column |
| 1069 | 1069 | * @param array<string> $search_terms |
| 1070 | 1070 | */ |
| 1071 | - private function whereSearch(Builder $query, Expression|string $column, array $search_terms): void |
|
| 1071 | + private function whereSearch(Builder $query, Expression | string $column, array $search_terms): void |
|
| 1072 | 1072 | { |
| 1073 | 1073 | foreach ($search_terms as $search_term) { |
| 1074 | 1074 | $query->where($column, DB::iLike(), '%' . addcslashes($search_term, '\\%_') . '%'); |
@@ -115,7 +115,7 @@ |
||
| 115 | 115 | ->flatten(); |
| 116 | 116 | |
| 117 | 117 | // Don't show family meta-data tags |
| 118 | - $exclude_facts = new Collection(['FAM:CHAN', 'FAM:_UID', 'FAM:UID', 'FAM:SUBM']); |
|
| 118 | + $exclude_facts = new Collection(['FAM:CHAN', 'FAM:_UID', 'FAM:UID', 'FAM:SUBM']); |
|
| 119 | 119 | // Don't show tags that are shown in tabs or sidebars |
| 120 | 120 | $exclude_facts = $exclude_facts->merge($sidebar_facts)->merge($tab_facts); |
| 121 | 121 | |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | string $line_endings, |
| 108 | 108 | string $filename, |
| 109 | 109 | string $format, |
| 110 | - Collection|null $records = null |
|
| 110 | + Collection | null $records = null |
|
| 111 | 111 | ): ResponseInterface { |
| 112 | 112 | $access_level = self::ACCESS_LEVELS[$privacy]; |
| 113 | 113 | |
@@ -177,9 +177,9 @@ discard block |
||
| 177 | 177 | string $encoding = UTF8::NAME, |
| 178 | 178 | int $access_level = Auth::PRIV_HIDE, |
| 179 | 179 | string $line_endings = 'CRLF', |
| 180 | - Collection|null $records = null, |
|
| 181 | - ZipArchive|FilesystemOperator|null $zip_filesystem = null, |
|
| 182 | - string|null $media_path = null |
|
| 180 | + Collection | null $records = null, |
|
| 181 | + ZipArchive | FilesystemOperator | null $zip_filesystem = null, |
|
| 182 | + string | null $media_path = null |
|
| 183 | 183 | ) { |
| 184 | 184 | $stream = fopen('php://memory', 'wb+'); |
| 185 | 185 | |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | /** |
| 165 | 165 | * @param list<int> $parent_place_ids |
| 166 | 166 | */ |
| 167 | - public function deleteUnusedLocations(int|null $parent_location_id, array $parent_place_ids): void |
|
| 167 | + public function deleteUnusedLocations(int | null $parent_location_id, array $parent_place_ids): void |
|
| 168 | 168 | { |
| 169 | 169 | if ($parent_location_id === null) { |
| 170 | 170 | $location_query = DB::table('place_location') |
@@ -199,7 +199,7 @@ discard block |
||
| 199 | 199 | * |
| 200 | 200 | * @return Collection<int,object{id:int,key:string,place:string,latitude:float|null,longitude:float|null,child_count:int,no_coord:int}> |
| 201 | 201 | */ |
| 202 | - public function getPlaceListLocation(int|null $parent_id): Collection |
|
| 202 | + public function getPlaceListLocation(int | null $parent_id): Collection |
|
| 203 | 203 | { |
| 204 | 204 | $expression = |
| 205 | 205 | DB::prefix('p1') . '.place IS NOT NULL AND ' . DB::prefix('p1') . '.latitude IS NULL OR ' . |
@@ -248,7 +248,7 @@ discard block |
||
| 248 | 248 | 'child_count' => (int) $row->child_count, |
| 249 | 249 | 'no_coord' => (int) $row->no_coord, |
| 250 | 250 | ]) |
| 251 | - ->sort(static fn (object $x, object $y): int => I18N::comparator()($x->place, $y->place)); |
|
| 251 | + ->sort(static fn (object $x, object $y) : int => I18N::comparator()($x->place, $y->place)); |
|
| 252 | 252 | } |
| 253 | 253 | |
| 254 | 254 | public function writeLatitude(float $latitude): string |
@@ -253,7 +253,7 @@ discard block |
||
| 253 | 253 | } |
| 254 | 254 | } |
| 255 | 255 | |
| 256 | - $validated_bot = false; |
|
| 256 | + $validated_bot = false; |
|
| 257 | 257 | |
| 258 | 258 | foreach (self::ROBOT_REV_FWD_DNS as $robot => $valid_domains) { |
| 259 | 259 | if (str_contains($ua, $robot)) { |
@@ -379,7 +379,7 @@ discard block |
||
| 379 | 379 | { |
| 380 | 380 | return Registry::cache()->file()->remember('whois-asn-' . $asn, function () use ($asn): array { |
| 381 | 381 | $ranges = $this->network_service->findIpRangesForAsn($asn); |
| 382 | - $mapper = static fn (string $range): RangeInterface|null => Factory::parseRangeString($range); |
|
| 382 | + $mapper = static fn (string $range): RangeInterface | null => Factory::parseRangeString($range); |
|
| 383 | 383 | $ranges = array_map($mapper, $ranges); |
| 384 | 384 | |
| 385 | 385 | return array_filter($ranges); |