@@ -438,12 +438,12 @@ discard block |
||
| 438 | 438 | { |
| 439 | 439 | $subtags = Registry::elementFactory()->make($record->tag())->subtags(); |
| 440 | 440 | |
| 441 | - $subtags = array_filter($subtags, fn (string $v, string $k) => !str_ends_with($v, ':1') || $record->facts([$k])->isEmpty(), ARRAY_FILTER_USE_BOTH); |
|
| 441 | + $subtags = array_filter($subtags, fn(string $v, string $k) => !str_ends_with($v, ':1') || $record->facts([$k])->isEmpty(), ARRAY_FILTER_USE_BOTH); |
|
| 442 | 442 | |
| 443 | 443 | $subtags = array_keys($subtags); |
| 444 | 444 | |
| 445 | 445 | if (!$include_hidden) { |
| 446 | - $fn_hidden = fn (string $t): bool => !$this->isHiddenTag($record->tag() . ':' . $t); |
|
| 446 | + $fn_hidden = fn(string $t): bool => !$this->isHiddenTag($record->tag() . ':' . $t); |
|
| 447 | 447 | $subtags = array_filter($subtags, $fn_hidden); |
| 448 | 448 | } |
| 449 | 449 | |
@@ -536,7 +536,7 @@ discard block |
||
| 536 | 536 | private function isHiddenTag(string $tag): bool |
| 537 | 537 | { |
| 538 | 538 | // Function to filter hidden tags. |
| 539 | - $fn_hide = fn (string $x): bool => (bool) Site::getPreference('HIDE_' . $x); |
|
| 539 | + $fn_hide = fn(string $x): bool => (bool) Site::getPreference('HIDE_' . $x); |
|
| 540 | 540 | |
| 541 | 541 | $preferences = array_filter(Gedcom::HIDDEN_TAGS, $fn_hide, ARRAY_FILTER_USE_KEY); |
| 542 | 542 | $preferences = array_values($preferences); |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | if ($note->canShow()) { |
| 162 | 162 | $noterec = $note->gedcom(); |
| 163 | 163 | $nt = preg_match("/0 @$nmatch[1]@ NOTE (.*)/", $noterec, $n1match); |
| 164 | - $data .= self::printNoteRecord($tree, $nt > 0 ? $n1match[1] : '', 1, $noterec); |
|
| 164 | + $data .= self::printNoteRecord($tree, $nt > 0 ? $n1match[1] : '', 1, $noterec); |
|
| 165 | 165 | } |
| 166 | 166 | } else { |
| 167 | 167 | $data = '<div class="fact_NOTE"><span class="label">' . I18N::translate('Note') . '</span>: <span class="field error">' . $nmatch[1] . '</span></div>'; |
@@ -379,7 +379,7 @@ discard block |
||
| 379 | 379 | if (preg_match_all('/\n3 (?:_HEB|ROMN) (.+)/', $placerec, $matches)) { |
| 380 | 380 | foreach ($matches[1] as $match) { |
| 381 | 381 | $wt_place = new Place($match, $tree); |
| 382 | - $html .= ' - ' . $wt_place->fullName(); |
|
| 382 | + $html .= ' - ' . $wt_place->fullName(); |
|
| 383 | 383 | } |
| 384 | 384 | } |
| 385 | 385 | |
@@ -393,7 +393,7 @@ discard block |
||
| 393 | 393 | // Links to external maps |
| 394 | 394 | $html .= app(ModuleService::class) |
| 395 | 395 | ->findByInterface(ModuleMapLinkInterface::class) |
| 396 | - ->map(fn (ModuleMapLinkInterface $module): string => ' ' . $module->mapLink($event)) |
|
| 396 | + ->map(fn(ModuleMapLinkInterface $module): string => ' ' . $module->mapLink($event)) |
|
| 397 | 397 | ->implode(''); |
| 398 | 398 | } |
| 399 | 399 | |
@@ -440,7 +440,7 @@ discard block |
||
| 440 | 440 | $quick_facts = explode(',', $tree->getPreference('INDI_FACTS_QUICK')); |
| 441 | 441 | $unique_facts = [ |
| 442 | 442 | 'ADOP', |
| 443 | - 'AFN' , |
|
| 443 | + 'AFN', |
|
| 444 | 444 | 'BAPL', |
| 445 | 445 | 'BAPM', |
| 446 | 446 | 'BARM', |
@@ -449,7 +449,7 @@ discard block |
||
| 449 | 449 | 'BURI', |
| 450 | 450 | 'CAST', |
| 451 | 451 | 'CHAN', |
| 452 | - 'CHR' , |
|
| 452 | + 'CHR', |
|
| 453 | 453 | 'CHRA', |
| 454 | 454 | 'CONF', |
| 455 | 455 | 'CONL', |
@@ -459,18 +459,18 @@ discard block |
||
| 459 | 459 | 'FCOM', |
| 460 | 460 | 'GRAD', |
| 461 | 461 | 'NCHI', |
| 462 | - 'NMR' , |
|
| 462 | + 'NMR', |
|
| 463 | 463 | 'ORDN', |
| 464 | 464 | 'PROB', |
| 465 | 465 | 'REFN', |
| 466 | 466 | 'RELI', |
| 467 | 467 | 'RESN', |
| 468 | 468 | 'RETI', |
| 469 | - 'RFN' , |
|
| 470 | - 'RIN' , |
|
| 471 | - 'SEX' , |
|
| 469 | + 'RFN', |
|
| 470 | + 'RIN', |
|
| 471 | + 'SEX', |
|
| 472 | 472 | 'SLGC', |
| 473 | - 'SSN' , |
|
| 473 | + 'SSN', |
|
| 474 | 474 | 'WILL', |
| 475 | 475 | ]; |
| 476 | 476 | break; |
@@ -492,13 +492,13 @@ discard block |
||
| 492 | 492 | } |
| 493 | 493 | |
| 494 | 494 | // Filter existing tags |
| 495 | - $filter_fn = fn ($tag): bool => !in_array($tag, $unique_facts, true) || $record->facts([$tag])->isEmpty(); |
|
| 495 | + $filter_fn = fn($tag): bool => !in_array($tag, $unique_facts, true) || $record->facts([$tag])->isEmpty(); |
|
| 496 | 496 | |
| 497 | 497 | $quick_facts = array_filter($quick_facts, $filter_fn); |
| 498 | 498 | |
| 499 | 499 | |
| 500 | 500 | // Create a label for a subtag |
| 501 | - $label_fn = fn ($subtag): string => Registry::elementFactory()->make($record->tag() . ':' . $subtag)->label(); |
|
| 501 | + $label_fn = fn($subtag): string => Registry::elementFactory()->make($record->tag() . ':' . $subtag)->label(); |
|
| 502 | 502 | |
| 503 | 503 | $quick_facts = array_combine($quick_facts, array_map($label_fn, $quick_facts)); |
| 504 | 504 | $add_facts = array_combine($add_facts, array_map($label_fn, $add_facts)); |
@@ -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 | |
@@ -244,7 +244,7 @@ discard block |
||
| 244 | 244 | $create_form = ''; |
| 245 | 245 | foreach ($media_trees as $media_tree => $media_directory) { |
| 246 | 246 | if (str_starts_with($row[0], $media_directory)) { |
| 247 | - $tmp = substr($row[0], strlen($media_directory)); |
|
| 247 | + $tmp = substr($row[0], strlen($media_directory)); |
|
| 248 | 248 | $create_form .= |
| 249 | 249 | '<p><a href="#" data-bs-toggle="modal" data-bs-backdrop="static" data-bs-target="#modal-create-media-from-file" data-file="' . e($tmp) . '" data-url="' . e(route(CreateMediaObjectFromFile::class, ['tree' => $media_tree])) . '" onclick="document.getElementById(\'modal-create-media-from-file-form\').action=this.dataset.url; document.getElementById(\'file\').value=this.dataset.file;">' . I18N::translate('Create') . '</a> — ' . e($media_tree) . '<p>'; |
| 250 | 250 | } |
@@ -349,7 +349,7 @@ discard block |
||
| 349 | 349 | // This will work for local filesystems. For remote filesystems, we will |
| 350 | 350 | // need to copy the file locally to work out the image size. |
| 351 | 351 | $imgsize = getimagesizefromstring($data_filesystem->read($file)); |
| 352 | - $html .= '<dt>' . I18N::translate('Image dimensions') . '</dt>'; |
|
| 352 | + $html .= '<dt>' . I18N::translate('Image dimensions') . '</dt>'; |
|
| 353 | 353 | /* I18N: image dimensions, width × height */ |
| 354 | 354 | $html .= '<dd>' . I18N::translate('%1$s × %2$s pixels', I18N::number($imgsize['0']), I18N::number($imgsize['1'])) . '</dd>'; |
| 355 | 355 | } catch (FilesystemException | UnableToReadFile | Throwable $ex) { |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | { |
| 81 | 81 | use ModuleChartTrait; |
| 82 | 82 | |
| 83 | - protected const ROUTE_URL = '/tree/{tree}/fan-chart-{style}-{generations}-{width}/{xref}'; |
|
| 83 | + protected const ROUTE_URL = '/tree/{tree}/fan-chart-{style}-{generations}-{width}/{xref}'; |
|
| 84 | 84 | |
| 85 | 85 | // Chart styles |
| 86 | 86 | private const STYLE_HALF_CIRCLE = '2'; |
@@ -432,7 +432,7 @@ discard block |
||
| 432 | 432 | ]); |
| 433 | 433 | |
| 434 | 434 | $text_lines = array_map( |
| 435 | - fn (string $line): string => $this->fitTextToPixelWidth($line, $max_text_length), |
|
| 435 | + fn(string $line): string => $this->fitTextToPixelWidth($line, $max_text_length), |
|
| 436 | 436 | $text_lines |
| 437 | 437 | ); |
| 438 | 438 | |
@@ -488,13 +488,13 @@ discard block |
||
| 488 | 488 | |
| 489 | 489 | foreach ($theme->individualBoxMenu($individual) as $menu) { |
| 490 | 490 | $link = $menu->getLink(); |
| 491 | - $class = $menu->getClass(); |
|
| 491 | + $class = $menu->getClass(); |
|
| 492 | 492 | $html .= '<a href="' . e($link) . '" class="dropdown-item p-1 ' . e($class) . '">'; |
| 493 | 493 | $html .= $menu->getLabel(); |
| 494 | 494 | $html .= '</a>'; |
| 495 | 495 | } |
| 496 | 496 | |
| 497 | - $html .= '</div>'; |
|
| 497 | + $html .= '</div>'; |
|
| 498 | 498 | } |
| 499 | 499 | } |
| 500 | 500 | } |
@@ -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(); |