@@ -108,7 +108,7 @@ |
||
| 108 | 108 | if (is_string($content)) { |
| 109 | 109 | $headers['Content-Type'] ??= 'text/html; charset=UTF-8'; |
| 110 | 110 | } else { |
| 111 | - $content = json_encode($content, JSON_THROW_ON_ERROR | JSON_UNESCAPED_UNICODE); |
|
| 111 | + $content = json_encode($content, JSON_THROW_ON_ERROR | JSON_UNESCAPED_UNICODE); |
|
| 112 | 112 | $headers['Content-Type'] ??= 'application/json'; |
| 113 | 113 | } |
| 114 | 114 | |
@@ -146,8 +146,8 @@ discard block |
||
| 146 | 146 | { |
| 147 | 147 | $default_events = implode(',', self::DEFAULT_EVENTS); |
| 148 | 148 | |
| 149 | - $days = (int)$this->getBlockSetting($block_id, 'days', self::DEFAULT_DAYS); |
|
| 150 | - $filter = (bool)$this->getBlockSetting($block_id, 'filter', self::DEFAULT_FILTER); |
|
| 149 | + $days = (int) $this->getBlockSetting($block_id, 'days', self::DEFAULT_DAYS); |
|
| 150 | + $filter = (bool) $this->getBlockSetting($block_id, 'filter', self::DEFAULT_FILTER); |
|
| 151 | 151 | $infoStyle = $this->getBlockSetting($block_id, 'infoStyle', self::DEFAULT_STYLE); |
| 152 | 152 | $sortStyle = $this->getBlockSetting($block_id, 'sortStyle', self::DEFAULT_SORT); |
| 153 | 153 | $events = $this->getBlockSetting($block_id, 'events', $default_events); |
@@ -256,8 +256,8 @@ discard block |
||
| 256 | 256 | $sort_style = Validator::parsedBody($request)->isInArrayKeys($this->sortStyles())->string('sortStyle'); |
| 257 | 257 | $events = Validator::parsedBody($request)->array('events'); |
| 258 | 258 | |
| 259 | - $this->setBlockSetting($block_id, 'days', (string)$days); |
|
| 260 | - $this->setBlockSetting($block_id, 'filter', (string)$filter); |
|
| 259 | + $this->setBlockSetting($block_id, 'days', (string) $days); |
|
| 260 | + $this->setBlockSetting($block_id, 'filter', (string) $filter); |
|
| 261 | 261 | $this->setBlockSetting($block_id, 'infoStyle', $info_style); |
| 262 | 262 | $this->setBlockSetting($block_id, 'sortStyle', $sort_style); |
| 263 | 263 | $this->setBlockSetting($block_id, 'events', implode(',', $events)); |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | |
| 94 | 94 | foreach ($components as $component) { |
| 95 | 95 | // Allow for upper/lower-case mismatches, and all-numeric XREFs |
| 96 | - $component = array_map(static fn ($x): string => strtolower((string) $x), $component); |
|
| 96 | + $component = array_map(static fn($x): string => strtolower((string) $x), $component); |
|
| 97 | 97 | |
| 98 | 98 | if (!in_array(strtolower($xref), $component, true)) { |
| 99 | 99 | $individual_groups[] = DB::table('individuals') |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | } |
| 106 | 106 | } |
| 107 | 107 | |
| 108 | - usort($individual_groups, static fn (Collection $x, Collection $y): int => count($x) <=> count($y)); |
|
| 108 | + usort($individual_groups, static fn(Collection $x, Collection $y): int => count($x) <=> count($y)); |
|
| 109 | 109 | |
| 110 | 110 | $title = I18N::translate('Find unrelated individuals') . ' — ' . e($tree->title()); |
| 111 | 111 | |
@@ -75,7 +75,7 @@ |
||
| 75 | 75 | ->union($union) |
| 76 | 76 | ->pluck('l_from'); |
| 77 | 77 | |
| 78 | - return $xrefs->map(static fn (string $xref) => Registry::gedcomRecordFactory()->make($xref, $record->tree())); |
|
| 78 | + return $xrefs->map(static fn(string $xref) => Registry::gedcomRecordFactory()->make($xref, $record->tree())); |
|
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | /** |
@@ -199,7 +199,7 @@ discard block |
||
| 199 | 199 | $currentLen = $endPos + 2; |
| 200 | 200 | $directive = substr($workingText, 0, $currentLen); |
| 201 | 201 | $workingText = substr($workingText, $currentLen); |
| 202 | - $result .= self::$waitingText . $directive; |
|
| 202 | + $result .= self::$waitingText . $directive; |
|
| 203 | 203 | self::$waitingText = ''; |
| 204 | 204 | break; |
| 205 | 205 | } |
@@ -310,7 +310,7 @@ discard block |
||
| 310 | 310 | if ($openParIndex !== false) { |
| 311 | 311 | // Opening parentheses always inherit the following directionality |
| 312 | 312 | self::$waitingText .= $currentLetter; |
| 313 | - $workingText = substr($workingText, $currentLen); |
|
| 313 | + $workingText = substr($workingText, $currentLen); |
|
| 314 | 314 | while (true) { |
| 315 | 315 | if ($workingText === '') { |
| 316 | 316 | break; |
@@ -318,13 +318,13 @@ discard block |
||
| 318 | 318 | if (str_starts_with($workingText, ' ')) { |
| 319 | 319 | // Spaces following this left parenthesis inherit the following directionality too |
| 320 | 320 | self::$waitingText .= ' '; |
| 321 | - $workingText = substr($workingText, 1); |
|
| 321 | + $workingText = substr($workingText, 1); |
|
| 322 | 322 | continue; |
| 323 | 323 | } |
| 324 | 324 | if (str_starts_with($workingText, ' ')) { |
| 325 | 325 | // Spaces following this left parenthesis inherit the following directionality too |
| 326 | 326 | self::$waitingText .= ' '; |
| 327 | - $workingText = substr($workingText, 6); |
|
| 327 | + $workingText = substr($workingText, 6); |
|
| 328 | 328 | continue; |
| 329 | 329 | } |
| 330 | 330 | break; |
@@ -341,9 +341,9 @@ discard block |
||
| 341 | 341 | // Exceptions to this rule will be handled later during final clean-up. |
| 342 | 342 | // |
| 343 | 343 | self::$waitingText .= $currentLetter; |
| 344 | - $workingText = substr($workingText, $currentLen); |
|
| 344 | + $workingText = substr($workingText, $currentLen); |
|
| 345 | 345 | if (self::$currentState !== '') { |
| 346 | - $result .= self::$waitingText; |
|
| 346 | + $result .= self::$waitingText; |
|
| 347 | 347 | self::$waitingText = ''; |
| 348 | 348 | } |
| 349 | 349 | break 2; // double break because we're waiting for more information |
@@ -472,7 +472,7 @@ discard block |
||
| 472 | 472 | } |
| 473 | 473 | if (substr($result . "\n", 0, self::LENGTH_START) !== self::START_LTR && substr($result . "\n", 0, self::LENGTH_START) !== self::START_RTL) { |
| 474 | 474 | $leadingText .= substr($result, 0, 1); |
| 475 | - $result = substr($result, 1); |
|
| 475 | + $result = substr($result, 1); |
|
| 476 | 476 | continue; |
| 477 | 477 | } |
| 478 | 478 | $result = substr($result, 0, self::LENGTH_START) . $leadingText . substr($result, self::LENGTH_START); |
@@ -614,11 +614,11 @@ discard block |
||
| 614 | 614 | private static function breakCurrentSpan(string &$result): void |
| 615 | 615 | { |
| 616 | 616 | // Interrupt the current span, insert that <br>, and then continue the current span |
| 617 | - $result .= self::$waitingText; |
|
| 617 | + $result .= self::$waitingText; |
|
| 618 | 618 | self::$waitingText = ''; |
| 619 | 619 | |
| 620 | 620 | $breakString = '<' . self::$currentState . 'br>'; |
| 621 | - $result .= $breakString; |
|
| 621 | + $result .= $breakString; |
|
| 622 | 622 | } |
| 623 | 623 | |
| 624 | 624 | /** |
@@ -675,7 +675,7 @@ discard block |
||
| 675 | 675 | break; |
| 676 | 676 | } // No more numeric strings |
| 677 | 677 | |
| 678 | - $tempResult .= substr($textSpan, 0, $posLRE + 3); // Copy everything preceding the numeric string |
|
| 678 | + $tempResult .= substr($textSpan, 0, $posLRE + 3); // Copy everything preceding the numeric string |
|
| 679 | 679 | $numericString = substr($textSpan, $posLRE + 3, $posPDF - $posLRE); // Separate the entire numeric string |
| 680 | 680 | $textSpan = substr($textSpan, $posPDF + 3); |
| 681 | 681 | $posColon = strpos($numericString, ':'); |
@@ -1142,7 +1142,7 @@ discard block |
||
| 1142 | 1142 | |
| 1143 | 1143 | // We're done: finish the span |
| 1144 | 1144 | $textSpan = self::starredName($textSpan, 'RTL'); // Wrap starred name in <u> and </u> tags |
| 1145 | - $result .= $textSpan . self::END_RTL; |
|
| 1145 | + $result .= $textSpan . self::END_RTL; |
|
| 1146 | 1146 | } |
| 1147 | 1147 | |
| 1148 | 1148 | if (self::$currentState !== 'LTR' && self::$currentState !== 'RTL') { |
@@ -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(static fn (int $n) => $pra($n - 1, 'prastarý otec', '%s prastarého otca'))->ancestor()->male(), |
|
| 151 | - Relationship::dynamic(static fn (int $n) => $pra($n - 1, 'prastará matka', '%s prastarej matky'))->ancestor()->female(), |
|
| 152 | - Relationship::dynamic(static fn (int $n) => $pra($n - 1, 'prastarý rodič', '%s prastarého rodiča'))->ancestor(), |
|
| 150 | + Relationship::dynamic(static fn(int $n) => $pra($n - 1, 'prastarý otec', '%s prastarého otca'))->ancestor()->male(), |
|
| 151 | + Relationship::dynamic(static fn(int $n) => $pra($n - 1, 'prastará matka', '%s prastarej matky'))->ancestor()->female(), |
|
| 152 | + Relationship::dynamic(static 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(static fn (int $n) => $pra($n - 1, 'pravnuk', '%s pravnuka'))->ancestor()->male(), |
|
| 163 | - Relationship::dynamic(static fn (int $n) => $pra($n - 1, 'pravnučka', '%s pravnučky'))->ancestor()->female(), |
|
| 164 | - Relationship::dynamic(static fn (int $n) => $pra($n - 1, 'pravnúča', '%s pravnúčaťa'))->ancestor(), |
|
| 162 | + Relationship::dynamic(static fn(int $n) => $pra($n - 1, 'pravnuk', '%s pravnuka'))->ancestor()->male(), |
|
| 163 | + Relationship::dynamic(static fn(int $n) => $pra($n - 1, 'pravnučka', '%s pravnučky'))->ancestor()->female(), |
|
| 164 | + Relationship::dynamic(static 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(static fn (int $n) => $pra($n - 2, 'prastrýko', '%s prastrýka'))->ancestor()->brother(), |
|
| 173 | - Relationship::dynamic(static fn (int $n) => $pra($n - 2, 'prateta', '%s pratety'))->ancestor()->sister(), |
|
| 172 | + Relationship::dynamic(static fn(int $n) => $pra($n - 2, 'prastrýko', '%s prastrýka'))->ancestor()->brother(), |
|
| 173 | + Relationship::dynamic(static 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(static fn (int $n) => $pra($n - 2, 'prasynovec', '%s prasynovca'))->sibling()->descendant()->son(), |
|
| 181 | - Relationship::dynamic(static fn (int $n) => $pra($n - 2, 'praneter', '%s pranetere'))->sibling()->descendant()->daughter(), |
|
| 180 | + Relationship::dynamic(static fn(int $n) => $pra($n - 2, 'prasynovec', '%s prasynovca'))->sibling()->descendant()->son(), |
|
| 181 | + Relationship::dynamic(static fn(int $n) => $pra($n - 2, 'praneter', '%s pranetere'))->sibling()->descendant()->daughter(), |
|
| 182 | 182 | // Cousins |
| 183 | - Relationship::dynamic(static fn (int $n): array => $cousin($n, static::FEMALE_COUSINS, '', ''))->symmetricCousin()->female(), |
|
| 184 | - Relationship::dynamic(static fn (int $n): array => $cousin($n, static::MALE_COUSINS, '', ''))->symmetricCousin()->male(), |
|
| 185 | - Relationship::dynamic(static fn (int $n): array => $cousin($n, static::MALE_COUSINS, '', ''))->symmetricCousin(), |
|
| 183 | + Relationship::dynamic(static fn(int $n): array => $cousin($n, static::FEMALE_COUSINS, '', ''))->symmetricCousin()->female(), |
|
| 184 | + Relationship::dynamic(static fn(int $n): array => $cousin($n, static::MALE_COUSINS, '', ''))->symmetricCousin()->male(), |
|
| 185 | + Relationship::dynamic(static fn(int $n): array => $cousin($n, static::MALE_COUSINS, '', ''))->symmetricCousin(), |
|
| 186 | 186 | ]; |
| 187 | 187 | } |
| 188 | 188 | } |
@@ -110,24 +110,24 @@ discard block |
||
| 110 | 110 | public function relationships(): array |
| 111 | 111 | { |
| 112 | 112 | // Construct the genitive form in French |
| 113 | - $genitive = static fn (string $s, string $genitive_link): array => [$s, '%s ' . $genitive_link . $s]; |
|
| 113 | + $genitive = static fn(string $s, string $genitive_link): array => [$s, '%s ' . $genitive_link . $s]; |
|
| 114 | 114 | |
| 115 | 115 | // Functions to coumpound the name that can be indefinitely repeated |
| 116 | - $degree = static fn (int $n, string $suffix, string $genitive_link): array => |
|
| 116 | + $degree = static fn(int $n, string $suffix, string $genitive_link): array => |
|
| 117 | 117 | $genitive($suffix . ' au ' . $n . '<sup>e</sup> degré', $genitive_link); |
| 118 | 118 | |
| 119 | - $great = static fn (int $n, string $suffix, string $genitive_link): array => |
|
| 119 | + $great = static fn(int $n, string $suffix, string $genitive_link): array => |
|
| 120 | 120 | $n <= 1 ? $genitive('arrière-' . $suffix, 'de l’') : $degree($n + 1, $suffix, $genitive_link); |
| 121 | 121 | |
| 122 | - $firstCompound = static fn (int $n, string $suffix, string $genitive_link): array => |
|
| 122 | + $firstCompound = static fn(int $n, string $suffix, string $genitive_link): array => |
|
| 123 | 123 | $n <= 1 ? $genitive($suffix, $genitive_link) : $great($n - 1, $suffix, $genitive_link); |
| 124 | 124 | |
| 125 | 125 | $compound = |
| 126 | - static fn (int $n, string $first_level, string $suffix, string $genitive_none, string $genitive_first): array => |
|
| 126 | + static fn(int $n, string $first_level, string $suffix, string $genitive_none, string $genitive_first): array => |
|
| 127 | 127 | $n <= 1 ? $genitive($suffix, $genitive_none) : $firstCompound($n - 1, $first_level . $suffix, $genitive_first); |
| 128 | 128 | |
| 129 | 129 | // Functions to translate cousins' degree of relationship |
| 130 | - $symmetricCousin = static fn (int $n, string $sex): array => self::SYMMETRIC_COUSINS[$n][$sex] ?? $genitive( |
|
| 130 | + $symmetricCousin = static fn(int $n, string $sex): array => self::SYMMETRIC_COUSINS[$n][$sex] ?? $genitive( |
|
| 131 | 131 | $sex === 'F' ? 'cousine au ' . $n . '<sup>e</sup> degré' : 'cousin au ' . $n . '<sup>e</sup> degré', |
| 132 | 132 | $sex === 'F' ? 'de la ' : 'du ' |
| 133 | 133 | ); |
@@ -144,8 +144,7 @@ discard block |
||
| 144 | 144 | } |
| 145 | 145 | return $genitive( |
| 146 | 146 | $sex === 'F' ? |
| 147 | - 'cousine du ' . $down . '<sup>e</sup> au ' . $up . '<sup>e</sup> degré' : |
|
| 148 | - 'cousin du ' . $down . '<sup>e</sup> au ' . $up . '<sup>e</sup> degré', |
|
| 147 | + 'cousine du ' . $down . '<sup>e</sup> au ' . $up . '<sup>e</sup> degré' : 'cousin du ' . $down . '<sup>e</sup> au ' . $up . '<sup>e</sup> degré', |
|
| 149 | 148 | $sex === 'F' ? 'de la ' : 'du ' |
| 150 | 149 | ); |
| 151 | 150 | }; |
@@ -247,31 +246,31 @@ discard block |
||
| 247 | 246 | Relationship::fixed('trisaïeul paternel', '%s du trisaïeul paternel')->father()->parent()->parent()->father(), |
| 248 | 247 | Relationship::fixed('trisaïeule', '%s de la trisaïeule')->parent()->parent()->parent()->mother(), |
| 249 | 248 | Relationship::fixed('trisaïeul', '%s du trisaïeul')->parent()->parent()->parent()->father(), |
| 250 | - Relationship::dynamic(static fn (int $n) => $firstCompound($n, 'grand-mère maternelle', 'de la '))->mother()->ancestor()->female(), |
|
| 251 | - Relationship::dynamic(static fn (int $n) => $firstCompound($n, 'grand-père maternel', 'du '))->mother()->ancestor()->male(), |
|
| 252 | - Relationship::dynamic(static fn (int $n) => $firstCompound($n, 'grand-parent maternel', 'du '))->mother()->ancestor(), |
|
| 253 | - Relationship::dynamic(static fn (int $n) => $firstCompound($n, 'grand-mère paternelle', 'de la '))->father()->ancestor()->female(), |
|
| 254 | - Relationship::dynamic(static fn (int $n) => $firstCompound($n, 'grand-père paternel', 'du '))->father()->ancestor()->male(), |
|
| 255 | - Relationship::dynamic(static fn (int $n) => $firstCompound($n, 'grand-parent paternel', 'du '))->father()->ancestor(), |
|
| 256 | - Relationship::dynamic(static fn (int $n) => $firstCompound($n, 'grand-mère', 'de la '))->parent()->ancestor()->female(), |
|
| 257 | - Relationship::dynamic(static fn (int $n) => $firstCompound($n, 'grand-père', 'du '))->parent()->ancestor()->male(), |
|
| 258 | - Relationship::dynamic(static fn (int $n) => $firstCompound($n, 'grand-parent', 'du '))->parent()->ancestor(), |
|
| 249 | + Relationship::dynamic(static fn(int $n) => $firstCompound($n, 'grand-mère maternelle', 'de la '))->mother()->ancestor()->female(), |
|
| 250 | + Relationship::dynamic(static fn(int $n) => $firstCompound($n, 'grand-père maternel', 'du '))->mother()->ancestor()->male(), |
|
| 251 | + Relationship::dynamic(static fn(int $n) => $firstCompound($n, 'grand-parent maternel', 'du '))->mother()->ancestor(), |
|
| 252 | + Relationship::dynamic(static fn(int $n) => $firstCompound($n, 'grand-mère paternelle', 'de la '))->father()->ancestor()->female(), |
|
| 253 | + Relationship::dynamic(static fn(int $n) => $firstCompound($n, 'grand-père paternel', 'du '))->father()->ancestor()->male(), |
|
| 254 | + Relationship::dynamic(static fn(int $n) => $firstCompound($n, 'grand-parent paternel', 'du '))->father()->ancestor(), |
|
| 255 | + Relationship::dynamic(static fn(int $n) => $firstCompound($n, 'grand-mère', 'de la '))->parent()->ancestor()->female(), |
|
| 256 | + Relationship::dynamic(static fn(int $n) => $firstCompound($n, 'grand-père', 'du '))->parent()->ancestor()->male(), |
|
| 257 | + Relationship::dynamic(static fn(int $n) => $firstCompound($n, 'grand-parent', 'du '))->parent()->ancestor(), |
|
| 259 | 258 | // Grandchildren and below |
| 260 | - Relationship::dynamic(static fn (int $n) => $firstCompound($n, 'petite-fille', 'de la '))->child()->descendant()->female(), |
|
| 261 | - Relationship::dynamic(static fn (int $n) => $firstCompound($n, 'petit-fils', 'du '))->child()->descendant()->male(), |
|
| 262 | - Relationship::dynamic(static fn (int $n) => $firstCompound($n, 'petit-enfant', 'du '))->child()->descendant(), |
|
| 259 | + Relationship::dynamic(static fn(int $n) => $firstCompound($n, 'petite-fille', 'de la '))->child()->descendant()->female(), |
|
| 260 | + Relationship::dynamic(static fn(int $n) => $firstCompound($n, 'petit-fils', 'du '))->child()->descendant()->male(), |
|
| 261 | + Relationship::dynamic(static fn(int $n) => $firstCompound($n, 'petit-enfant', 'du '))->child()->descendant(), |
|
| 263 | 262 | // Collateral relatives |
| 264 | - Relationship::dynamic(static fn (int $n) => $compound($n, 'grand-', 'tante', 'de la ', 'de la '))->ancestor()->sister(), |
|
| 265 | - Relationship::dynamic(static fn (int $n) => $compound($n, 'grand-', 'tante par alliance', 'de la ', 'de la '))->ancestor()->sibling()->wife(), |
|
| 266 | - Relationship::dynamic(static fn (int $n) => $compound($n, 'grand-', 'oncle', 'de l’', 'du '))->ancestor()->brother(), |
|
| 267 | - Relationship::dynamic(static fn (int $n) => $compound($n, 'grand-', 'oncle par alliance', 'de l’', 'du '))->ancestor()->sibling()->husband(), |
|
| 268 | - Relationship::dynamic(static fn (int $n) => $compound($n, 'petite-', 'nièce', 'de la ', 'de la '))->sibling()->descendant()->female(), |
|
| 269 | - Relationship::dynamic(static fn (int $n) => $compound($n, 'petite-', 'nièce par alliance', 'de la ', 'de la '))->married()->spouse()->sibling()->descendant()->female(), |
|
| 270 | - Relationship::dynamic(static fn (int $n) => $compound($n, 'petit-', 'neveu', 'du ', 'du '))->sibling()->descendant()->male(), |
|
| 271 | - Relationship::dynamic(static fn (int $n) => $compound($n, 'petit-', 'neveu par alliance', 'du ', 'du '))->married()->spouse()->sibling()->descendant()->male(), |
|
| 263 | + Relationship::dynamic(static fn(int $n) => $compound($n, 'grand-', 'tante', 'de la ', 'de la '))->ancestor()->sister(), |
|
| 264 | + Relationship::dynamic(static fn(int $n) => $compound($n, 'grand-', 'tante par alliance', 'de la ', 'de la '))->ancestor()->sibling()->wife(), |
|
| 265 | + Relationship::dynamic(static fn(int $n) => $compound($n, 'grand-', 'oncle', 'de l’', 'du '))->ancestor()->brother(), |
|
| 266 | + Relationship::dynamic(static fn(int $n) => $compound($n, 'grand-', 'oncle par alliance', 'de l’', 'du '))->ancestor()->sibling()->husband(), |
|
| 267 | + Relationship::dynamic(static fn(int $n) => $compound($n, 'petite-', 'nièce', 'de la ', 'de la '))->sibling()->descendant()->female(), |
|
| 268 | + Relationship::dynamic(static fn(int $n) => $compound($n, 'petite-', 'nièce par alliance', 'de la ', 'de la '))->married()->spouse()->sibling()->descendant()->female(), |
|
| 269 | + Relationship::dynamic(static fn(int $n) => $compound($n, 'petit-', 'neveu', 'du ', 'du '))->sibling()->descendant()->male(), |
|
| 270 | + Relationship::dynamic(static fn(int $n) => $compound($n, 'petit-', 'neveu par alliance', 'du ', 'du '))->married()->spouse()->sibling()->descendant()->male(), |
|
| 272 | 271 | // Cousins (based on canon law) |
| 273 | - Relationship::dynamic(static fn (int $up, int $down) => $cousin($up, $down, 'F'))->cousin()->female(), |
|
| 274 | - Relationship::dynamic(static fn (int $up, int $down) => $cousin($up, $down, 'M'))->cousin()->male(), |
|
| 272 | + Relationship::dynamic(static fn(int $up, int $down) => $cousin($up, $down, 'F'))->cousin()->female(), |
|
| 273 | + Relationship::dynamic(static fn(int $up, int $down) => $cousin($up, $down, 'M'))->cousin()->male(), |
|
| 275 | 274 | |
| 276 | 275 | ]; |
| 277 | 276 | } |
@@ -121,15 +121,15 @@ discard block |
||
| 121 | 121 | public function relationships(): array |
| 122 | 122 | { |
| 123 | 123 | // Genitive forms in English are simple/regular, as no relationship name ends in "s". |
| 124 | - $genitive = static fn (string $s): array => [$s, $s . '’s %s']; |
|
| 124 | + $genitive = static fn(string $s): array => [$s, $s . '’s %s']; |
|
| 125 | 125 | |
| 126 | - $cousin = static fn (int $up, int $down): array => $genitive( |
|
| 126 | + $cousin = static fn(int $up, int $down): array => $genitive( |
|
| 127 | 127 | (static::COUSIN[min($up, $down)] ?? 'distant cousin') . |
| 128 | 128 | (static::REMOVED[abs($up - $down)] ?? ' many times removed') . |
| 129 | 129 | static::DIRECTION[$up <=> $down] |
| 130 | 130 | ); |
| 131 | 131 | |
| 132 | - $great = static fn (int $n, string $prefix, string $suffix): array => $genitive( |
|
| 132 | + $great = static fn(int $n, string $prefix, string $suffix): array => $genitive( |
|
| 133 | 133 | $prefix . ($n > 3 ? 'great ×' . $n . ' ' : str_repeat('great-', $n)) . $suffix |
| 134 | 134 | ); |
| 135 | 135 | |
@@ -224,22 +224,22 @@ discard block |
||
| 224 | 224 | Relationship::fixed('grandson', 'grandson’s %s')->child()->son(), |
| 225 | 225 | Relationship::fixed('grandchild', 'grandchild’s %s')->child()->child(), |
| 226 | 226 | // Relationships with dynamically generated names |
| 227 | - Relationship::dynamic(static fn (int $n) => $great($n - 1, '', 'aunt'))->ancestor()->sister(), |
|
| 228 | - Relationship::dynamic(static fn (int $n) => $great($n - 1, '', 'aunt'))->ancestor()->sibling()->wife(), |
|
| 229 | - Relationship::dynamic(static fn (int $n) => $great($n - 1, '', 'uncle'))->ancestor()->brother(), |
|
| 230 | - Relationship::dynamic(static fn (int $n) => $great($n - 1, '', 'uncle'))->ancestor()->sibling()->husband(), |
|
| 231 | - Relationship::dynamic(static fn (int $n) => $great($n - 1, '', 'niece'))->sibling()->descendant()->female(), |
|
| 232 | - Relationship::dynamic(static fn (int $n) => $great($n - 1, '', 'niece'))->married()->spouse()->sibling()->descendant()->female(), |
|
| 233 | - Relationship::dynamic(static fn (int $n) => $great($n - 1, '', 'nephew'))->sibling()->descendant()->male(), |
|
| 234 | - Relationship::dynamic(static fn (int $n) => $great($n - 1, '', 'nephew'))->married()->spouse()->sibling()->descendant()->male(), |
|
| 235 | - Relationship::dynamic(static fn (int $n) => $great($n - 2, 'maternal ', 'grandmother'))->mother()->ancestor()->female(), |
|
| 236 | - Relationship::dynamic(static fn (int $n) => $great($n - 1, 'maternal ', 'grandfather'))->mother()->ancestor()->male(), |
|
| 237 | - Relationship::dynamic(static fn (int $n) => $great($n - 1, 'paternal ', 'grandmother'))->father()->ancestor()->female(), |
|
| 238 | - Relationship::dynamic(static fn (int $n) => $great($n - 1, 'paternal ', 'grandfather'))->father()->ancestor()->male(), |
|
| 239 | - Relationship::dynamic(static fn (int $n) => $great($n - 1, '', 'grandparent'))->ancestor(), |
|
| 240 | - Relationship::dynamic(static fn (int $n) => $great($n - 2, '', 'granddaughter'))->descendant()->female(), |
|
| 241 | - Relationship::dynamic(static fn (int $n) => $great($n - 2, '', 'grandson'))->descendant()->male(), |
|
| 242 | - Relationship::dynamic(static fn (int $n) => $great($n - 2, '', 'grandchild'))->descendant(), |
|
| 227 | + Relationship::dynamic(static fn(int $n) => $great($n - 1, '', 'aunt'))->ancestor()->sister(), |
|
| 228 | + Relationship::dynamic(static fn(int $n) => $great($n - 1, '', 'aunt'))->ancestor()->sibling()->wife(), |
|
| 229 | + Relationship::dynamic(static fn(int $n) => $great($n - 1, '', 'uncle'))->ancestor()->brother(), |
|
| 230 | + Relationship::dynamic(static fn(int $n) => $great($n - 1, '', 'uncle'))->ancestor()->sibling()->husband(), |
|
| 231 | + Relationship::dynamic(static fn(int $n) => $great($n - 1, '', 'niece'))->sibling()->descendant()->female(), |
|
| 232 | + Relationship::dynamic(static fn(int $n) => $great($n - 1, '', 'niece'))->married()->spouse()->sibling()->descendant()->female(), |
|
| 233 | + Relationship::dynamic(static fn(int $n) => $great($n - 1, '', 'nephew'))->sibling()->descendant()->male(), |
|
| 234 | + Relationship::dynamic(static fn(int $n) => $great($n - 1, '', 'nephew'))->married()->spouse()->sibling()->descendant()->male(), |
|
| 235 | + Relationship::dynamic(static fn(int $n) => $great($n - 2, 'maternal ', 'grandmother'))->mother()->ancestor()->female(), |
|
| 236 | + Relationship::dynamic(static fn(int $n) => $great($n - 1, 'maternal ', 'grandfather'))->mother()->ancestor()->male(), |
|
| 237 | + Relationship::dynamic(static fn(int $n) => $great($n - 1, 'paternal ', 'grandmother'))->father()->ancestor()->female(), |
|
| 238 | + Relationship::dynamic(static fn(int $n) => $great($n - 1, 'paternal ', 'grandfather'))->father()->ancestor()->male(), |
|
| 239 | + Relationship::dynamic(static fn(int $n) => $great($n - 1, '', 'grandparent'))->ancestor(), |
|
| 240 | + Relationship::dynamic(static fn(int $n) => $great($n - 2, '', 'granddaughter'))->descendant()->female(), |
|
| 241 | + Relationship::dynamic(static fn(int $n) => $great($n - 2, '', 'grandson'))->descendant()->male(), |
|
| 242 | + Relationship::dynamic(static fn(int $n) => $great($n - 2, '', 'grandchild'))->descendant(), |
|
| 243 | 243 | Relationship::dynamic($cousin)->ancestor()->sibling()->descendant(), |
| 244 | 244 | ]; |
| 245 | 245 | } |
@@ -259,7 +259,7 @@ |
||
| 259 | 259 | ->where('m_file', '=', $this->tree->id()) |
| 260 | 260 | ->groupBy('source_media_type') |
| 261 | 261 | ->pluck(new Expression('COUNT(*)'), 'source_media_type') |
| 262 | - ->map(static fn (string $n): int => (int) $n) |
|
| 262 | + ->map(static fn(string $n): int => (int) $n) |
|
| 263 | 263 | ->all(); |
| 264 | 264 | |
| 265 | 265 | return (new ChartMedia($this->color_service)) |