@@ -784,7 +784,7 @@ discard block |
||
| 784 | 784 | $access_level = $access_level ?? Auth::accessLevel($this->tree); |
| 785 | 785 | |
| 786 | 786 | // Convert BIRT into INDI:BIRT, etc. |
| 787 | - $filter = array_map(fn (string $tag): string => $this->tag() . ':' . $tag, $filter); |
|
| 787 | + $filter = array_map(fn(string $tag): string => $this->tag() . ':' . $tag, $filter); |
|
| 788 | 788 | |
| 789 | 789 | $facts = new Collection(); |
| 790 | 790 | if ($this->canShow($access_level)) { |
@@ -804,7 +804,7 @@ discard block |
||
| 804 | 804 | |
| 805 | 805 | default: |
| 806 | 806 | $subtags = Registry::elementFactory()->make($this->tag())->subtags(); |
| 807 | - $subtags = array_map(fn (string $tag): string => $this->tag() . ':' . $tag, array_keys($subtags)); |
|
| 807 | + $subtags = array_map(fn(string $tag): string => $this->tag() . ':' . $tag, array_keys($subtags)); |
|
| 808 | 808 | $subtags = array_combine(range(1, count($subtags)), $subtags); |
| 809 | 809 | |
| 810 | 810 | $facts = $facts |
@@ -198,9 +198,9 @@ |
||
| 198 | 198 | }; |
| 199 | 199 | |
| 200 | 200 | return $default_facts |
| 201 | - ->reject(fn (string $field): bool => array_key_exists($field, $fields)) |
|
| 201 | + ->reject(fn(string $field): bool => array_key_exists($field, $fields)) |
|
| 202 | 202 | ->sort($comparator) |
| 203 | - ->mapWithKeys(fn (string $fact): array => [$fact => Registry::elementFactory()->make($fact)->label()]) |
|
| 203 | + ->mapWithKeys(fn(string $fact): array => [$fact => Registry::elementFactory()->make($fact)->label()]) |
|
| 204 | 204 | ->all(); |
| 205 | 205 | } |
| 206 | 206 | |
@@ -56,7 +56,7 @@ |
||
| 56 | 56 | |
| 57 | 57 | try { |
| 58 | 58 | return $this->media_file_service->mediaFolders($tree) |
| 59 | - ->filter(fn (string $path): bool => stripos($path, $query) !== false); |
|
| 59 | + ->filter(fn(string $path): bool => stripos($path, $query) !== false); |
|
| 60 | 60 | } catch (FilesystemException $ex) { |
| 61 | 61 | return new Collection(); |
| 62 | 62 | } |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | $currentLen = $endPos + 2; |
| 187 | 187 | $directive = substr($workingText, 0, $currentLen); |
| 188 | 188 | $workingText = substr($workingText, $currentLen); |
| 189 | - $result .= self::$waitingText . $directive; |
|
| 189 | + $result .= self::$waitingText . $directive; |
|
| 190 | 190 | self::$waitingText = ''; |
| 191 | 191 | break; |
| 192 | 192 | } |
@@ -299,7 +299,7 @@ discard block |
||
| 299 | 299 | if ($openParIndex !== false) { |
| 300 | 300 | // Opening parentheses always inherit the following directionality |
| 301 | 301 | self::$waitingText .= $currentLetter; |
| 302 | - $workingText = substr($workingText, $currentLen); |
|
| 302 | + $workingText = substr($workingText, $currentLen); |
|
| 303 | 303 | while (true) { |
| 304 | 304 | if ($workingText === '') { |
| 305 | 305 | break; |
@@ -307,13 +307,13 @@ discard block |
||
| 307 | 307 | if (substr($workingText, 0, 1) === ' ') { |
| 308 | 308 | // Spaces following this left parenthesis inherit the following directionality too |
| 309 | 309 | self::$waitingText .= ' '; |
| 310 | - $workingText = substr($workingText, 1); |
|
| 310 | + $workingText = substr($workingText, 1); |
|
| 311 | 311 | continue; |
| 312 | 312 | } |
| 313 | 313 | if (substr($workingText, 0, 6) === ' ') { |
| 314 | 314 | // Spaces following this left parenthesis inherit the following directionality too |
| 315 | 315 | self::$waitingText .= ' '; |
| 316 | - $workingText = substr($workingText, 6); |
|
| 316 | + $workingText = substr($workingText, 6); |
|
| 317 | 317 | continue; |
| 318 | 318 | } |
| 319 | 319 | break; |
@@ -330,9 +330,9 @@ discard block |
||
| 330 | 330 | // Exceptions to this rule will be handled later during final clean-up. |
| 331 | 331 | // |
| 332 | 332 | self::$waitingText .= $currentLetter; |
| 333 | - $workingText = substr($workingText, $currentLen); |
|
| 333 | + $workingText = substr($workingText, $currentLen); |
|
| 334 | 334 | if (self::$currentState !== '') { |
| 335 | - $result .= self::$waitingText; |
|
| 335 | + $result .= self::$waitingText; |
|
| 336 | 336 | self::$waitingText = ''; |
| 337 | 337 | } |
| 338 | 338 | break 2; // double break because we're waiting for more information |
@@ -463,7 +463,7 @@ discard block |
||
| 463 | 463 | } |
| 464 | 464 | if (substr($result . "\n", 0, self::LENGTH_START) !== self::START_LTR && substr($result . "\n", 0, self::LENGTH_START) !== self::START_RTL) { |
| 465 | 465 | $leadingText .= substr($result, 0, 1); |
| 466 | - $result = substr($result, 1); |
|
| 466 | + $result = substr($result, 1); |
|
| 467 | 467 | continue; |
| 468 | 468 | } |
| 469 | 469 | $result = substr($result, 0, self::LENGTH_START) . $leadingText . substr($result, self::LENGTH_START); |
@@ -600,11 +600,11 @@ discard block |
||
| 600 | 600 | public static function breakCurrentSpan(string &$result): void |
| 601 | 601 | { |
| 602 | 602 | // Interrupt the current span, insert that <br>, and then continue the current span |
| 603 | - $result .= self::$waitingText; |
|
| 603 | + $result .= self::$waitingText; |
|
| 604 | 604 | self::$waitingText = ''; |
| 605 | 605 | |
| 606 | 606 | $breakString = '<' . self::$currentState . 'br>'; |
| 607 | - $result .= $breakString; |
|
| 607 | + $result .= $breakString; |
|
| 608 | 608 | } |
| 609 | 609 | |
| 610 | 610 | /** |
@@ -661,7 +661,7 @@ discard block |
||
| 661 | 661 | break; |
| 662 | 662 | } // No more numeric strings |
| 663 | 663 | |
| 664 | - $tempResult .= substr($textSpan, 0, $posLRE + 3); // Copy everything preceding the numeric string |
|
| 664 | + $tempResult .= substr($textSpan, 0, $posLRE + 3); // Copy everything preceding the numeric string |
|
| 665 | 665 | $numericString = substr($textSpan, $posLRE + 3, $posPDF - $posLRE); // Separate the entire numeric string |
| 666 | 666 | $textSpan = substr($textSpan, $posPDF + 3); |
| 667 | 667 | $posColon = strpos($numericString, ':'); |
@@ -1128,7 +1128,7 @@ discard block |
||
| 1128 | 1128 | |
| 1129 | 1129 | // We're done: finish the span |
| 1130 | 1130 | $textSpan = self::starredName($textSpan, 'RTL'); // Wrap starred name in <u> and </u> tags |
| 1131 | - $result .= $textSpan . self::END_RTL; |
|
| 1131 | + $result .= $textSpan . self::END_RTL; |
|
| 1132 | 1132 | } |
| 1133 | 1133 | |
| 1134 | 1134 | if (self::$currentState !== 'LTR' && self::$currentState !== 'RTL') { |
@@ -49,8 +49,8 @@ |
||
| 49 | 49 | */ |
| 50 | 50 | public static function surnameTagCloud(array $surnames, ?ModuleListInterface $module, bool $totals, Tree $tree): string |
| 51 | 51 | { |
| 52 | - $maximum = max(array_map(static fn (array $x): int => max($x), $surnames)); |
|
| 53 | - $minimum = min(array_map(static fn (array $x): int => min($x), $surnames)); |
|
| 52 | + $maximum = max(array_map(static fn(array $x) : int => max($x), $surnames)); |
|
| 53 | + $minimum = min(array_map(static fn(array $x): int => min($x), $surnames)); |
|
| 54 | 54 | |
| 55 | 55 | $tag_cloud = ''; |
| 56 | 56 | |
@@ -726,7 +726,7 @@ |
||
| 726 | 726 | |
| 727 | 727 | $lines = explode("\n", $str); |
| 728 | 728 | |
| 729 | - $lines = array_map(fn (string $string): string => $this->utf8WordWrap($string, $line_width), $lines); |
|
| 729 | + $lines = array_map(fn(string $string): string => $this->utf8WordWrap($string, $line_width), $lines); |
|
| 730 | 730 | |
| 731 | 731 | return implode("\n", $lines); |
| 732 | 732 | } |
@@ -259,7 +259,7 @@ |
||
| 259 | 259 | private function fetchIpRangesForAsn(string $asn): array |
| 260 | 260 | { |
| 261 | 261 | return Registry::cache()->file()->remember('whois-asn-' . $asn, static function () use ($asn): array { |
| 262 | - $mapper = static fn (AsnRouteInfo $route_info): ?RangeInterface => IPFactory::parseRangeString($route_info->route ?: $route_info->route6); |
|
| 262 | + $mapper = static fn(AsnRouteInfo $route_info): ?RangeInterface => IPFactory::parseRangeString($route_info->route ?: $route_info->route6); |
|
| 263 | 263 | |
| 264 | 264 | try { |
| 265 | 265 | $loader = new CurlLoader(self::WHOIS_TIMEOUT); |
@@ -173,19 +173,19 @@ |
||
| 173 | 173 | $ignore_facts = ['CHAN', 'CHIL', 'FAMC', 'FAMS', 'HUSB', 'NOTE', 'OBJE', 'SOUR', 'SUBM', 'WIFE']; |
| 174 | 174 | |
| 175 | 175 | $all_family_facts = Collection::make(Registry::elementFactory()->make('FAM')->subtags()) |
| 176 | - ->filter(static fn (string $value, string $key): bool => !in_array($key, $ignore_facts, true)) |
|
| 177 | - ->mapWithKeys(static fn (string $value, string $key): array => [$key => 'FAM:' . $key]) |
|
| 178 | - ->map(static fn (string $tag): ElementInterface => Registry::elementFactory()->make($tag)) |
|
| 179 | - ->filter(static fn (ElementInterface $element): bool => !$element instanceof UnknownElement) |
|
| 180 | - ->map(static fn (ElementInterface $element): string => $element->label()) |
|
| 176 | + ->filter(static fn(string $value, string $key): bool => !in_array($key, $ignore_facts, true)) |
|
| 177 | + ->mapWithKeys(static fn(string $value, string $key): array => [$key => 'FAM:' . $key]) |
|
| 178 | + ->map(static fn(string $tag): ElementInterface => Registry::elementFactory()->make($tag)) |
|
| 179 | + ->filter(static fn(ElementInterface $element): bool => !$element instanceof UnknownElement) |
|
| 180 | + ->map(static fn(ElementInterface $element): string => $element->label()) |
|
| 181 | 181 | ->sort(I18N::comparator()); |
| 182 | 182 | |
| 183 | 183 | $all_individual_facts = Collection::make(Registry::elementFactory()->make('INDI')->subtags()) |
| 184 | - ->filter(static fn (string $value, string $key): bool => !in_array($key, $ignore_facts, true)) |
|
| 185 | - ->mapWithKeys(static fn (string $value, string $key): array => [$key => 'INDI:' . $key]) |
|
| 186 | - ->map(static fn (string $tag): ElementInterface => Registry::elementFactory()->make($tag)) |
|
| 187 | - ->filter(static fn (ElementInterface $element): bool => !$element instanceof UnknownElement) |
|
| 188 | - ->map(static fn (ElementInterface $element): string => $element->label()) |
|
| 184 | + ->filter(static fn(string $value, string $key): bool => !in_array($key, $ignore_facts, true)) |
|
| 185 | + ->mapWithKeys(static fn(string $value, string $key): array => [$key => 'INDI:' . $key]) |
|
| 186 | + ->map(static fn(string $tag): ElementInterface => Registry::elementFactory()->make($tag)) |
|
| 187 | + ->filter(static fn(ElementInterface $element): bool => !$element instanceof UnknownElement) |
|
| 188 | + ->map(static fn(ElementInterface $element): string => $element->label()) |
|
| 189 | 189 | ->sort(I18N::comparator()); |
| 190 | 190 | |
| 191 | 191 | $all_surname_traditions = SurnameTradition::allDescriptions(); |
@@ -202,7 +202,7 @@ |
||
| 202 | 202 | ->where('id', '=', $location->id) |
| 203 | 203 | ->delete(); |
| 204 | 204 | } else { |
| 205 | - $place_ids = $places->map(static fn (object $place): int => (int) $place->p_id)->all(); |
|
| 205 | + $place_ids = $places->map(static fn(object $place): int => (int) $place->p_id)->all(); |
|
| 206 | 206 | $this->deleteUnusedLocations((int) $location->id, $place_ids); |
| 207 | 207 | } |
| 208 | 208 | } |