@@ -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' => [ |
@@ -86,12 +86,12 @@ discard block |
||
86 | 86 | */ |
87 | 87 | public function relationships(): array |
88 | 88 | { |
89 | - $pra = static fn (int $n, string $nominative, string $genitive): array => [ |
|
89 | + $pra = static fn(int $n, string $nominative, string $genitive): array => [ |
|
90 | 90 | ($n > 3 ? 'pra ×' . $n . ' ' : str_repeat('pra-', $n)) . $nominative, |
91 | 91 | ($n > 3 ? 'pra ×' . $n . ' ' : str_repeat('pra-', $n)) . $genitive, |
92 | 92 | ]; |
93 | 93 | |
94 | - $cousin = static fn (int $n, array $cousins, string $nominative, string $genitive): array => $cousins[$n] ?? [ |
|
94 | + $cousin = static fn(int $n, array $cousins, string $nominative, string $genitive): array => $cousins[$n] ?? [ |
|
95 | 95 | $nominative . ' z ' . $n . '. kolena', |
96 | 96 | $genitive . '%s z ' . $n . '. kolena', |
97 | 97 | ]; |
@@ -147,9 +147,9 @@ discard block |
||
147 | 147 | Relationship::fixed('prastarý otec', '%s prastarého otca')->parent()->parent()->mother(), |
148 | 148 | Relationship::fixed('prastarý otec', '%s prastarého otca')->parent()->parent()->parent(), |
149 | 149 | // Ancestors |
150 | - Relationship::dynamic(fn (int $n) => $pra($n - 1, 'prastarý otec', '%s prastarého otca'))->ancestor()->male(), |
|
151 | - Relationship::dynamic(fn (int $n) => $pra($n - 1, 'prastará matka', '%s prastarej matky'))->ancestor()->female(), |
|
152 | - Relationship::dynamic(fn (int $n) => $pra($n - 1, 'prastarý rodič', '%s prastarého rodiča'))->ancestor(), |
|
150 | + Relationship::dynamic(fn(int $n) => $pra($n - 1, 'prastarý otec', '%s prastarého otca'))->ancestor()->male(), |
|
151 | + Relationship::dynamic(fn(int $n) => $pra($n - 1, 'prastará matka', '%s prastarej matky'))->ancestor()->female(), |
|
152 | + Relationship::dynamic(fn(int $n) => $pra($n - 1, 'prastarý rodič', '%s prastarého rodiča'))->ancestor(), |
|
153 | 153 | // Grandchildren |
154 | 154 | Relationship::fixed('vnuk', '%s vnuka')->child()->son(), |
155 | 155 | Relationship::fixed('vnučka', '%s vnučky')->child()->daughter(), |
@@ -159,9 +159,9 @@ discard block |
||
159 | 159 | Relationship::fixed('pravnučka', '%s pravnučky')->child()->child()->daughter(), |
160 | 160 | Relationship::fixed('pravnúča', '%s pravnúčaťa')->child()->child()->child(), |
161 | 161 | // Descendants |
162 | - Relationship::dynamic(fn (int $n) => $pra($n - 1, 'pravnuk', '%s pravnuka'))->ancestor()->male(), |
|
163 | - Relationship::dynamic(fn (int $n) => $pra($n - 1, 'pravnučka', '%s pravnučky'))->ancestor()->female(), |
|
164 | - Relationship::dynamic(fn (int $n) => $pra($n - 1, 'pravnúča', '%s pravnúčaťa'))->ancestor(), |
|
162 | + Relationship::dynamic(fn(int $n) => $pra($n - 1, 'pravnuk', '%s pravnuka'))->ancestor()->male(), |
|
163 | + Relationship::dynamic(fn(int $n) => $pra($n - 1, 'pravnučka', '%s pravnučky'))->ancestor()->female(), |
|
164 | + Relationship::dynamic(fn(int $n) => $pra($n - 1, 'pravnúča', '%s pravnúčaťa'))->ancestor(), |
|
165 | 165 | // Aunts and uncles |
166 | 166 | Relationship::fixed('ujo', '%s uja')->mother()->brother(), |
167 | 167 | Relationship::fixed('ujčiná', '%s ujčinej')->mother()->brother()->wife(), |
@@ -169,20 +169,20 @@ discard block |
||
169 | 169 | Relationship::fixed('strýko', '%s strýka')->parent()->brother(), |
170 | 170 | Relationship::fixed('teta', '%s tety')->parent()->sister(), |
171 | 171 | // Great-aunts and great-uncles |
172 | - Relationship::dynamic(fn (int $n) => $pra($n - 2, 'prastrýko', '%s prastrýka'))->ancestor()->brother(), |
|
173 | - Relationship::dynamic(fn (int $n) => $pra($n - 2, 'prateta', '%s pratety'))->ancestor()->sister(), |
|
172 | + Relationship::dynamic(fn(int $n) => $pra($n - 2, 'prastrýko', '%s prastrýka'))->ancestor()->brother(), |
|
173 | + Relationship::dynamic(fn(int $n) => $pra($n - 2, 'prateta', '%s pratety'))->ancestor()->sister(), |
|
174 | 174 | // Nieces and nephews |
175 | 175 | Relationship::fixed('synovec', '%s synovca')->sibling()->son(), |
176 | 176 | Relationship::fixed('neter', '%s netere')->sibling()->daughter(), |
177 | 177 | // Great-nieces and great-nephews |
178 | 178 | Relationship::fixed('prasynovec', '%s prasynovca')->sibling()->child()->son(), |
179 | 179 | Relationship::fixed('praneter', '%s pranetere')->sibling()->child()->daughter(), |
180 | - Relationship::dynamic(fn (int $n) => $pra($n - 2, 'prasynovec', '%s prasynovca'))->sibling()->descendant()->son(), |
|
181 | - Relationship::dynamic(fn (int $n) => $pra($n - 2, 'praneter', '%s pranetere'))->sibling()->descendant()->daughter(), |
|
180 | + Relationship::dynamic(fn(int $n) => $pra($n - 2, 'prasynovec', '%s prasynovca'))->sibling()->descendant()->son(), |
|
181 | + Relationship::dynamic(fn(int $n) => $pra($n - 2, 'praneter', '%s pranetere'))->sibling()->descendant()->daughter(), |
|
182 | 182 | // Cousins |
183 | - Relationship::dynamic(fn (int $n): array => $cousin($n, static::FEMALE_COUSINS, '', ''))->symmetricCousin()->female(), |
|
184 | - Relationship::dynamic(fn (int $n): array => $cousin($n, static::MALE_COUSINS, '', ''))->symmetricCousin()->male(), |
|
185 | - Relationship::dynamic(fn (int $n): array => $cousin($n, static::MALE_COUSINS, '', ''))->symmetricCousin(), |
|
183 | + Relationship::dynamic(fn(int $n): array => $cousin($n, static::FEMALE_COUSINS, '', ''))->symmetricCousin()->female(), |
|
184 | + Relationship::dynamic(fn(int $n): array => $cousin($n, static::MALE_COUSINS, '', ''))->symmetricCousin()->male(), |
|
185 | + Relationship::dynamic(fn(int $n): array => $cousin($n, static::MALE_COUSINS, '', ''))->symmetricCousin(), |
|
186 | 186 | ]; |
187 | 187 | } |
188 | 188 | } |
@@ -117,6 +117,6 @@ |
||
117 | 117 | */ |
118 | 118 | public function supportedFacts(): Collection |
119 | 119 | { |
120 | - return new Collection(array_map(static fn (string $tag): string => 'INDI:' . $tag, static::HANDLED_FACTS)); |
|
120 | + return new Collection(array_map(static fn(string $tag): string => 'INDI:' . $tag, static::HANDLED_FACTS)); |
|
121 | 121 | } |
122 | 122 | } |
@@ -118,15 +118,15 @@ discard block |
||
118 | 118 | public function relationships(): array |
119 | 119 | { |
120 | 120 | // Genitive forms in English are simple/regular, as no relationship name ends in "s". |
121 | - $genitive = static fn (string $s): array => [$s, $s . '’s %s']; |
|
121 | + $genitive = static fn(string $s): array => [$s, $s . '’s %s']; |
|
122 | 122 | |
123 | - $cousin = fn (int $up, int $down): array => $genitive( |
|
123 | + $cousin = fn(int $up, int $down): array => $genitive( |
|
124 | 124 | (static::COUSIN[min($up, $down)] ?? 'distant cousin') . |
125 | 125 | (static::REMOVED[abs($up - $down)] ?? ' many times removed') . |
126 | 126 | static::DIRECTION[$up <=> $down] |
127 | 127 | ); |
128 | 128 | |
129 | - $great = static fn (int $n, string $prefix, string $suffix): array => $genitive( |
|
129 | + $great = static fn(int $n, string $prefix, string $suffix): array => $genitive( |
|
130 | 130 | $prefix . ($n > 3 ? 'great ×' . $n . ' ' : str_repeat('great-', $n)) . $suffix |
131 | 131 | ); |
132 | 132 | |
@@ -221,22 +221,22 @@ discard block |
||
221 | 221 | Relationship::fixed('grandson', 'grandson’s %s')->child()->son(), |
222 | 222 | Relationship::fixed('grandchild', 'grandchild’s %s')->child()->child(), |
223 | 223 | // Relationships with dynamically generated names |
224 | - Relationship::dynamic(fn (int $n) => $great($n - 1, '', 'aunt'))->ancestor()->sister(), |
|
225 | - Relationship::dynamic(fn (int $n) => $great($n - 1, '', 'aunt'))->ancestor()->sibling()->wife(), |
|
226 | - Relationship::dynamic(fn (int $n) => $great($n - 1, '', 'uncle'))->ancestor()->brother(), |
|
227 | - Relationship::dynamic(fn (int $n) => $great($n - 1, '', 'uncle'))->ancestor()->sibling()->husband(), |
|
228 | - Relationship::dynamic(fn (int $n) => $great($n - 1, '', 'niece'))->sibling()->descendant()->female(), |
|
229 | - Relationship::dynamic(fn (int $n) => $great($n - 1, '', 'niece'))->married()->spouse()->sibling()->descendant()->female(), |
|
230 | - Relationship::dynamic(fn (int $n) => $great($n - 1, '', 'nephew'))->sibling()->descendant()->male(), |
|
231 | - Relationship::dynamic(fn (int $n) => $great($n - 1, '', 'nephew'))->married()->spouse()->sibling()->descendant()->male(), |
|
232 | - Relationship::dynamic(fn (int $n) => $great($n - 2, 'maternal ', 'grandmother'))->mother()->ancestor()->female(), |
|
233 | - Relationship::dynamic(fn (int $n) => $great($n - 1, 'maternal ', 'grandfather'))->mother()->ancestor()->male(), |
|
234 | - Relationship::dynamic(fn (int $n) => $great($n - 1, 'paternal ', 'grandmother'))->father()->ancestor()->female(), |
|
235 | - Relationship::dynamic(fn (int $n) => $great($n - 1, 'paternal ', 'grandfather'))->father()->ancestor()->male(), |
|
236 | - Relationship::dynamic(fn (int $n) => $great($n - 1, '', 'grandparent'))->ancestor(), |
|
237 | - Relationship::dynamic(fn (int $n) => $great($n - 2, '', 'granddaughter'))->descendant()->female(), |
|
238 | - Relationship::dynamic(fn (int $n) => $great($n - 2, '', 'grandson'))->descendant()->male(), |
|
239 | - Relationship::dynamic(fn (int $n) => $great($n - 2, '', 'grandchild'))->descendant(), |
|
224 | + Relationship::dynamic(fn(int $n) => $great($n - 1, '', 'aunt'))->ancestor()->sister(), |
|
225 | + Relationship::dynamic(fn(int $n) => $great($n - 1, '', 'aunt'))->ancestor()->sibling()->wife(), |
|
226 | + Relationship::dynamic(fn(int $n) => $great($n - 1, '', 'uncle'))->ancestor()->brother(), |
|
227 | + Relationship::dynamic(fn(int $n) => $great($n - 1, '', 'uncle'))->ancestor()->sibling()->husband(), |
|
228 | + Relationship::dynamic(fn(int $n) => $great($n - 1, '', 'niece'))->sibling()->descendant()->female(), |
|
229 | + Relationship::dynamic(fn(int $n) => $great($n - 1, '', 'niece'))->married()->spouse()->sibling()->descendant()->female(), |
|
230 | + Relationship::dynamic(fn(int $n) => $great($n - 1, '', 'nephew'))->sibling()->descendant()->male(), |
|
231 | + Relationship::dynamic(fn(int $n) => $great($n - 1, '', 'nephew'))->married()->spouse()->sibling()->descendant()->male(), |
|
232 | + Relationship::dynamic(fn(int $n) => $great($n - 2, 'maternal ', 'grandmother'))->mother()->ancestor()->female(), |
|
233 | + Relationship::dynamic(fn(int $n) => $great($n - 1, 'maternal ', 'grandfather'))->mother()->ancestor()->male(), |
|
234 | + Relationship::dynamic(fn(int $n) => $great($n - 1, 'paternal ', 'grandmother'))->father()->ancestor()->female(), |
|
235 | + Relationship::dynamic(fn(int $n) => $great($n - 1, 'paternal ', 'grandfather'))->father()->ancestor()->male(), |
|
236 | + Relationship::dynamic(fn(int $n) => $great($n - 1, '', 'grandparent'))->ancestor(), |
|
237 | + Relationship::dynamic(fn(int $n) => $great($n - 2, '', 'granddaughter'))->descendant()->female(), |
|
238 | + Relationship::dynamic(fn(int $n) => $great($n - 2, '', 'grandson'))->descendant()->male(), |
|
239 | + Relationship::dynamic(fn(int $n) => $great($n - 2, '', 'grandchild'))->descendant(), |
|
240 | 240 | Relationship::dynamic($cousin)->ancestor()->sibling()->descendant(), |
241 | 241 | ]; |
242 | 242 | } |
@@ -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 | |
@@ -492,13 +492,13 @@ discard block |
||
492 | 492 | } |
493 | 493 | |
494 | 494 | // Filter existing tags |
495 | - $filter_fn = static fn (string $tag): bool => !in_array($tag, $unique_facts, true) || $record->facts([$tag])->isEmpty(); |
|
495 | + $filter_fn = static fn(string $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 = static fn (string $subtag): string => Registry::elementFactory()->make($record->tag() . ':' . $subtag)->label(); |
|
501 | + $label_fn = static fn(string $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)); |
@@ -148,7 +148,7 @@ |
||
148 | 148 | } |
149 | 149 | |
150 | 150 | // We may use markup to display values, but not when editing them. |
151 | - $values = array_map(static fn (string $x): string => strip_tags($x), $values); |
|
151 | + $values = array_map(static fn(string $x): string => strip_tags($x), $values); |
|
152 | 152 | |
153 | 153 | return view('components/select', [ |
154 | 154 | 'id' => $id, |
@@ -98,7 +98,7 @@ |
||
98 | 98 | |
99 | 99 | foreach ($components as $component) { |
100 | 100 | // Allow for upper/lower-case mismatches, and all-numeric XREFs |
101 | - $component = array_map(static fn ($x): string => strtolower((string) $x), $component); |
|
101 | + $component = array_map(static fn($x): string => strtolower((string) $x), $component); |
|
102 | 102 | |
103 | 103 | if (!in_array(strtolower($xref), $component, true)) { |
104 | 104 | $individual_groups[] = DB::table('individuals') |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | ->groupBy(['surname']) |
120 | 120 | ->select([new Expression('n_surname /*! COLLATE utf8_bin */ AS surname'), new Expression('count(*) AS total')]) |
121 | 121 | ->pluck('total', 'surname') |
122 | - ->map(static fn (string $n): int => (int) $n) |
|
122 | + ->map(static fn(string $n): int => (int) $n) |
|
123 | 123 | ->all(); |
124 | 124 | |
125 | 125 | $all_surnames[$top_surname] = $variants; |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | break; |
148 | 148 | |
149 | 149 | case 'list': |
150 | - uasort($all_surnames, static fn (array $a, array $b): int => array_sum($b) <=> array_sum($a)); |
|
150 | + uasort($all_surnames, static fn(array $a, array $b): int => array_sum($b) <=> array_sum($a)); |
|
151 | 151 | $content = view('lists/surnames-bullet-list', [ |
152 | 152 | 'module' => $module, |
153 | 153 | 'surnames' => $all_surnames, |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | break; |
158 | 158 | |
159 | 159 | case 'array': |
160 | - uasort($all_surnames, static fn (array $a, array $b): int => array_sum($b) <=> array_sum($a)); |
|
160 | + uasort($all_surnames, static fn(array $a, array $b): int => array_sum($b) <=> array_sum($a)); |
|
161 | 161 | $content = view('lists/surnames-compact-list', [ |
162 | 162 | 'module' => $module, |
163 | 163 | 'surnames' => $all_surnames, |