@@ -438,15 +438,15 @@ discard block |
||
438 | 438 | { |
439 | 439 | $subtags = Registry::elementFactory()->make($record->tag())->subtags(); |
440 | 440 | |
441 | - $subtags = array_filter($subtags, static fn (string $v, string $k) => !str_ends_with($v, ':1') || $record->facts([$k])->isEmpty(), ARRAY_FILTER_USE_BOTH); |
|
441 | + $subtags = array_filter($subtags, static 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 | // Don't include facts/events that we have hidden in the control panel. |
446 | - $subtags = array_filter($subtags, fn (string $subtag): bool => !$this->isHiddenTag($record->tag() . ':' . $subtag)); |
|
446 | + $subtags = array_filter($subtags, fn(string $subtag): bool => !$this->isHiddenTag($record->tag() . ':' . $subtag)); |
|
447 | 447 | |
448 | 448 | if (!$include_hidden) { |
449 | - $fn_hidden = fn (string $t): bool => !$this->isHiddenTag($record->tag() . ':' . $t); |
|
449 | + $fn_hidden = fn(string $t): bool => !$this->isHiddenTag($record->tag() . ':' . $t); |
|
450 | 450 | $subtags = array_filter($subtags, $fn_hidden); |
451 | 451 | } |
452 | 452 | |
@@ -539,7 +539,7 @@ discard block |
||
539 | 539 | private function isHiddenTag(string $tag): bool |
540 | 540 | { |
541 | 541 | // Function to filter hidden tags. |
542 | - $fn_hide = static fn (string $x): bool => (bool) Site::getPreference('HIDE_' . $x); |
|
542 | + $fn_hide = static fn(string $x): bool => (bool) Site::getPreference('HIDE_' . $x); |
|
543 | 543 | |
544 | 544 | $preferences = array_filter(Gedcom::HIDDEN_TAGS, $fn_hide, ARRAY_FILTER_USE_KEY); |
545 | 545 | $preferences = array_values($preferences); |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | */ |
82 | 82 | public static function fixed(string $nominative, string $genitive): Relationship |
83 | 83 | { |
84 | - return new self(fn () => [$nominative, $genitive]); |
|
84 | + return new self(fn() => [$nominative, $genitive]); |
|
85 | 85 | } |
86 | 86 | |
87 | 87 | /** |
@@ -126,9 +126,9 @@ discard block |
||
126 | 126 | */ |
127 | 127 | public function adopted(): Relationship |
128 | 128 | { |
129 | - $this->matchers[] = static fn (array $nodes): bool => count($nodes) > 2 && $nodes[2] |
|
129 | + $this->matchers[] = static fn(array $nodes): bool => count($nodes) > 2 && $nodes[2] |
|
130 | 130 | ->facts(['FAMC'], false, Auth::PRIV_HIDE) |
131 | - ->contains(fn (Fact $fact): bool => $fact->value() === '@' . $nodes[1]->xref() . '@' && $fact->attribute('PEDI') === 'adopted'); |
|
131 | + ->contains(fn(Fact $fact): bool => $fact->value() === '@' . $nodes[1]->xref() . '@' && $fact->attribute('PEDI') === 'adopted'); |
|
132 | 132 | |
133 | 133 | return $this; |
134 | 134 | } |
@@ -138,9 +138,9 @@ discard block |
||
138 | 138 | */ |
139 | 139 | public function adoptive(): Relationship |
140 | 140 | { |
141 | - $this->matchers[] = static fn (array $nodes): bool => $nodes[0] |
|
141 | + $this->matchers[] = static fn(array $nodes): bool => $nodes[0] |
|
142 | 142 | ->facts(['FAMC'], false, Auth::PRIV_HIDE) |
143 | - ->contains(fn (Fact $fact): bool => $fact->value() === '@' . $nodes[1]->xref() . '@' && $fact->attribute('PEDI') === 'adopted'); |
|
143 | + ->contains(fn(Fact $fact): bool => $fact->value() === '@' . $nodes[1]->xref() . '@' && $fact->attribute('PEDI') === 'adopted'); |
|
144 | 144 | |
145 | 145 | return $this; |
146 | 146 | } |
@@ -346,9 +346,9 @@ discard block |
||
346 | 346 | */ |
347 | 347 | public function fostered(): Relationship |
348 | 348 | { |
349 | - $this->matchers[] = static fn (array $nodes): bool => count($nodes) > 2 && $nodes[2] |
|
349 | + $this->matchers[] = static fn(array $nodes): bool => count($nodes) > 2 && $nodes[2] |
|
350 | 350 | ->facts(['FAMC'], false, Auth::PRIV_HIDE) |
351 | - ->contains(fn (Fact $fact): bool => $fact->value() === '@' . $nodes[1]->xref() . '@' && $fact->attribute('PEDI') === 'foster'); |
|
351 | + ->contains(fn(Fact $fact): bool => $fact->value() === '@' . $nodes[1]->xref() . '@' && $fact->attribute('PEDI') === 'foster'); |
|
352 | 352 | |
353 | 353 | return $this; |
354 | 354 | } |
@@ -358,9 +358,9 @@ discard block |
||
358 | 358 | */ |
359 | 359 | public function fostering(): Relationship |
360 | 360 | { |
361 | - $this->matchers[] = static fn (array $nodes): bool => $nodes[0] |
|
361 | + $this->matchers[] = static fn(array $nodes): bool => $nodes[0] |
|
362 | 362 | ->facts(['FAMC'], false, Auth::PRIV_HIDE) |
363 | - ->contains(fn (Fact $fact): bool => $fact->value() === '@' . $nodes[1]->xref() . '@' && $fact->attribute('PEDI') === 'foster'); |
|
363 | + ->contains(fn(Fact $fact): bool => $fact->value() === '@' . $nodes[1]->xref() . '@' && $fact->attribute('PEDI') === 'foster'); |
|
364 | 364 | |
365 | 365 | return $this; |
366 | 366 | } |
@@ -403,8 +403,8 @@ discard block |
||
403 | 403 | public function older(): Relationship |
404 | 404 | { |
405 | 405 | $this->matchers[] = static function (array $nodes): bool { |
406 | - $date1 = $nodes[0]->facts(['BIRT'], false, Auth::PRIV_HIDE)->map(fn (Fact $fact): Date => $fact->date())->first() ?? new Date(''); |
|
407 | - $date2 = $nodes[2]->facts(['BIRT'], false, Auth::PRIV_HIDE)->map(fn (Fact $fact): Date => $fact->date())->first() ?? new Date(''); |
|
406 | + $date1 = $nodes[0]->facts(['BIRT'], false, Auth::PRIV_HIDE)->map(fn(Fact $fact): Date => $fact->date())->first() ?? new Date(''); |
|
407 | + $date2 = $nodes[2]->facts(['BIRT'], false, Auth::PRIV_HIDE)->map(fn(Fact $fact): Date => $fact->date())->first() ?? new Date(''); |
|
408 | 408 | |
409 | 409 | return Date::compare($date1, $date2) > 0; |
410 | 410 | }; |
@@ -503,8 +503,8 @@ discard block |
||
503 | 503 | public function twin(): Relationship |
504 | 504 | { |
505 | 505 | $this->matchers[] = static function (array $nodes): bool { |
506 | - $date1 = $nodes[0]->facts(['BIRT'], false, Auth::PRIV_HIDE)->map(fn (Fact $fact): Date => $fact->date())->first() ?? new Date(''); |
|
507 | - $date2 = $nodes[2]->facts(['BIRT'], false, Auth::PRIV_HIDE)->map(fn (Fact $fact): Date => $fact->date())->first() ?? new Date(''); |
|
506 | + $date1 = $nodes[0]->facts(['BIRT'], false, Auth::PRIV_HIDE)->map(fn(Fact $fact): Date => $fact->date())->first() ?? new Date(''); |
|
507 | + $date2 = $nodes[2]->facts(['BIRT'], false, Auth::PRIV_HIDE)->map(fn(Fact $fact): Date => $fact->date())->first() ?? new Date(''); |
|
508 | 508 | |
509 | 509 | return |
510 | 510 | $date1->isOK() && |
@@ -531,8 +531,8 @@ discard block |
||
531 | 531 | public function younger(): Relationship |
532 | 532 | { |
533 | 533 | $this->matchers[] = static function (array $nodes): bool { |
534 | - $date1 = $nodes[0]->facts(['BIRT'], false, Auth::PRIV_HIDE)->map(fn (Fact $fact): Date => $fact->date())->first() ?? new Date(''); |
|
535 | - $date2 = $nodes[2]->facts(['BIRT'], false, Auth::PRIV_HIDE)->map(fn (Fact $fact): Date => $fact->date())->first() ?? new Date(''); |
|
534 | + $date1 = $nodes[0]->facts(['BIRT'], false, Auth::PRIV_HIDE)->map(fn(Fact $fact): Date => $fact->date())->first() ?? new Date(''); |
|
535 | + $date2 = $nodes[2]->facts(['BIRT'], false, Auth::PRIV_HIDE)->map(fn(Fact $fact): Date => $fact->date())->first() ?? new Date(''); |
|
536 | 536 | |
537 | 537 | return Date::compare($date1, $date2) < 0; |
538 | 538 | }; |
@@ -80,7 +80,7 @@ |
||
80 | 80 | // Default names facts. |
81 | 81 | $surname_tradition = SurnameTradition::create($tree->getPreference('SURNAME_TRADITION')); |
82 | 82 | $names = $surname_tradition->newParentNames($individual, $sex); |
83 | - $name_facts = array_map(static fn (string $gedcom): Fact => new Fact($gedcom, $dummy, ''), $names); |
|
83 | + $name_facts = array_map(static fn(string $gedcom): Fact => new Fact($gedcom, $dummy, ''), $names); |
|
84 | 84 | |
85 | 85 | $facts = [ |
86 | 86 | 'i' => [ |
@@ -86,7 +86,7 @@ |
||
86 | 86 | // Default names facts. |
87 | 87 | $surname_tradition = SurnameTradition::create($tree->getPreference('SURNAME_TRADITION')); |
88 | 88 | $names = $surname_tradition->newSpouseNames($individual, $sex); |
89 | - $name_facts = array_map(static fn (string $gedcom): Fact => new Fact($gedcom, $dummyi, ''), $names); |
|
89 | + $name_facts = array_map(static fn(string $gedcom): Fact => new Fact($gedcom, $dummyi, ''), $names); |
|
90 | 90 | |
91 | 91 | $facts = [ |
92 | 92 | 'i' => [ |
@@ -94,7 +94,7 @@ |
||
94 | 94 | |
95 | 95 | case 'name': |
96 | 96 | $name_tags = Registry::elementFactory()->make('INDI:NAME')->subtags(); |
97 | - $name_tags = array_map(static fn (string $tag): string => '2 ' . $tag, $name_tags); |
|
97 | + $name_tags = array_map(static fn(string $tag): string => '2 ' . $tag, $name_tags); |
|
98 | 98 | $name_tags[] = '1 NAME'; |
99 | 99 | |
100 | 100 | $records = $this->search_service->searchIndividuals([$tree], [$search]); |
@@ -84,7 +84,7 @@ |
||
84 | 84 | $spouse = $family->spouses()->first(); |
85 | 85 | assert($spouse instanceof Individual); |
86 | 86 | $names = $surname_tradition->newSpouseNames($spouse, $sex); |
87 | - $name_facts = array_map(static fn (string $gedcom): Fact => new Fact($gedcom, $dummyi, ''), $names); |
|
87 | + $name_facts = array_map(static fn(string $gedcom): Fact => new Fact($gedcom, $dummyi, ''), $names); |
|
88 | 88 | |
89 | 89 | $facts = [ |
90 | 90 | 'i' => [ |
@@ -91,7 +91,7 @@ |
||
91 | 91 | break; |
92 | 92 | } |
93 | 93 | |
94 | - $name_facts = array_map(static fn (string $gedcom): Fact => new Fact($gedcom, $dummy, ''), $names); |
|
94 | + $name_facts = array_map(static fn(string $gedcom): Fact => new Fact($gedcom, $dummy, ''), $names); |
|
95 | 95 | |
96 | 96 | $facts = [ |
97 | 97 | 'i' => [ |
@@ -80,7 +80,7 @@ |
||
80 | 80 | // Default names facts. |
81 | 81 | $surname_tradition = SurnameTradition::create($tree->getPreference('SURNAME_TRADITION')); |
82 | 82 | $names = $surname_tradition->newChildNames($family->husband(), $family->wife(), $sex); |
83 | - $name_facts = array_map(static fn (string $gedcom): Fact => new Fact($gedcom, $dummy, ''), $names); |
|
83 | + $name_facts = array_map(static fn(string $gedcom): Fact => new Fact($gedcom, $dummy, ''), $names); |
|
84 | 84 | |
85 | 85 | $facts = [ |
86 | 86 | 'i' => [ |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | ->groupBy(['surname']) |
114 | 114 | ->select([new Expression('n_surname /*! COLLATE utf8_bin */ AS surname'), new Expression('count(*) AS total')]) |
115 | 115 | ->pluck('total', 'surname') |
116 | - ->map(static fn (string $n): int => (int) $n) |
|
116 | + ->map(static fn(string $n): int => (int) $n) |
|
117 | 117 | ->all(); |
118 | 118 | |
119 | 119 | $all_surnames[$top_surname] = $variants; |
@@ -135,11 +135,11 @@ discard block |
||
135 | 135 | $content = FunctionsPrintLists::surnameTagCloud($all_surnames, $module, true, $tree); |
136 | 136 | break; |
137 | 137 | case 'list': |
138 | - uasort($all_surnames, static fn (array $a, array $b): int => array_sum($b) <=> array_sum($a)); |
|
138 | + uasort($all_surnames, static fn(array $a, array $b): int => array_sum($b) <=> array_sum($a)); |
|
139 | 139 | $content = FunctionsPrintLists::surnameList($all_surnames, 1, true, $module, $tree); |
140 | 140 | break; |
141 | 141 | case 'array': |
142 | - uasort($all_surnames, static fn (array $a, array $b): int => array_sum($b) <=> array_sum($a)); |
|
142 | + uasort($all_surnames, static fn(array $a, array $b): int => array_sum($b) <=> array_sum($a)); |
|
143 | 143 | $content = FunctionsPrintLists::surnameList($all_surnames, 2, true, $module, $tree); |
144 | 144 | break; |
145 | 145 | case 'table': |