Completed
Pull Request — main (#3916)
by Jonathan
06:23
created
app/Module/LanguageFrench.php 1 patch
Spacing   +33 added lines, -34 removed lines patch added patch discarded remove patch
@@ -34,12 +34,12 @@  discard block
 block discarded – undo
34 34
         1 => [
35 35
             'F' => ['cousine germaine', '$s de la cousine germaine'],
36 36
             'M' => ['cousin germain', '$s du cousin germain'],
37
-            'U' => ['cousin germain', '%s du cousin germain' ]
37
+            'U' => ['cousin germain', '%s du cousin germain']
38 38
         ],
39 39
         2 => [
40 40
             'F' => ['cousine issue de germain', '$s de la cousine issue de germain'],
41 41
             'M' => ['cousin issu de germain', '$s du cousin issu de germain'],
42
-            'U' => ['cousin issu de germain', '%s du cousin issu de germain' ]
42
+            'U' => ['cousin issu de germain', '%s du cousin issu de germain']
43 43
         ]
44 44
     ];
45 45
 
@@ -110,26 +110,26 @@  discard block
 block discarded – undo
110 110
     public function relationships(): array
111 111
     {
112 112
         // Construct the genitive form in French
113
-        $genitive = fn (string $s, string $genitive_link): array => [$s, '%s ' . $genitive_link . $s];
113
+        $genitive = 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 = fn (int $n, string $suffix, string $genitive_link): array =>
116
+        $degree = 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 = fn (int $n, string $suffix, string $genitive_link): array =>
119
+        $great = 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 = fn (int $n, string $suffix, string $genitive_link): array =>
122
+        $firstCompound = 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
-            fn (int $n, string $first_level, string $suffix, string $genitive_none, string $genitive_first): array =>
126
+            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 = fn (int $n, string $sex): array => self::SYMMETRIC_COUSINS[$n][$sex] ?? $genitive(
130
+        $symmetricCousin = 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
-            $sex === 'F'  ? 'de la ' : 'du '
132
+            $sex === 'F' ? 'de la ' : 'du '
133 133
         );
134 134
 
135 135
         $cousin =
@@ -144,9 +144,8 @@  discard block
 block discarded – undo
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é',
149
-                    $sex === 'F'  ? 'de la ' : 'du '
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é',
148
+                    $sex === 'F' ? 'de la ' : 'du '
150 149
                 );
151 150
             };
152 151
 
@@ -264,31 +263,31 @@  discard block
 block discarded – undo
264 263
             Relationship::fixed('trisaïeul paternel', '% du trisaïeul paternel')->father()->parent()->parent()->father(),
265 264
             Relationship::fixed('trisaïeule', '% de la trisaïeule')->parent()->parent()->parent()->mother(),
266 265
             Relationship::fixed('trisaïeul', '% du trisaïeul')->parent()->parent()->parent()->father(),
267
-            Relationship::dynamic(fn (int $n) => $firstCompound($n, 'grand-mère maternelle', 'de la '))->mother()->ancestor()->female(),
268
-            Relationship::dynamic(fn (int $n) => $firstCompound($n, 'grand-père maternel', 'du '))->mother()->ancestor()->male(),
269
-            Relationship::dynamic(fn (int $n) => $firstCompound($n, 'grand-parent maternel', 'du '))->mother()->ancestor(),
270
-            Relationship::dynamic(fn (int $n) => $firstCompound($n, 'grand-mère paternelle', 'de la '))->father()->ancestor()->female(),
271
-            Relationship::dynamic(fn (int $n) => $firstCompound($n, 'grand-père paternel', 'du '))->father()->ancestor()->male(),
272
-            Relationship::dynamic(fn (int $n) => $firstCompound($n, 'grand-parent paternel', 'du '))->father()->ancestor(),
273
-            Relationship::dynamic(fn (int $n) => $firstCompound($n, 'grand-mère', 'de la '))->parent()->ancestor()->female(),
274
-            Relationship::dynamic(fn (int $n) => $firstCompound($n, 'grand-père', 'du '))->parent()->ancestor()->male(),
275
-            Relationship::dynamic(fn (int $n) => $firstCompound($n, 'grand-parent', 'du '))->parent()->ancestor(),
266
+            Relationship::dynamic(fn(int $n) => $firstCompound($n, 'grand-mère maternelle', 'de la '))->mother()->ancestor()->female(),
267
+            Relationship::dynamic(fn(int $n) => $firstCompound($n, 'grand-père maternel', 'du '))->mother()->ancestor()->male(),
268
+            Relationship::dynamic(fn(int $n) => $firstCompound($n, 'grand-parent maternel', 'du '))->mother()->ancestor(),
269
+            Relationship::dynamic(fn(int $n) => $firstCompound($n, 'grand-mère paternelle', 'de la '))->father()->ancestor()->female(),
270
+            Relationship::dynamic(fn(int $n) => $firstCompound($n, 'grand-père paternel', 'du '))->father()->ancestor()->male(),
271
+            Relationship::dynamic(fn(int $n) => $firstCompound($n, 'grand-parent paternel', 'du '))->father()->ancestor(),
272
+            Relationship::dynamic(fn(int $n) => $firstCompound($n, 'grand-mère', 'de la '))->parent()->ancestor()->female(),
273
+            Relationship::dynamic(fn(int $n) => $firstCompound($n, 'grand-père', 'du '))->parent()->ancestor()->male(),
274
+            Relationship::dynamic(fn(int $n) => $firstCompound($n, 'grand-parent', 'du '))->parent()->ancestor(),
276 275
             // Grandchildren and below
277
-            Relationship::dynamic(fn (int $n) => $firstCompound($n, 'petite-fille', 'de la '))->child()->descendant()->female(),
278
-            Relationship::dynamic(fn (int $n) => $firstCompound($n, 'petit-fils', 'du '))->child()->descendant()->male(),
279
-            Relationship::dynamic(fn (int $n) => $firstCompound($n, 'petit-enfant', 'du '))->child()->descendant(),
276
+            Relationship::dynamic(fn(int $n) => $firstCompound($n, 'petite-fille', 'de la '))->child()->descendant()->female(),
277
+            Relationship::dynamic(fn(int $n) => $firstCompound($n, 'petit-fils', 'du '))->child()->descendant()->male(),
278
+            Relationship::dynamic(fn(int $n) => $firstCompound($n, 'petit-enfant', 'du '))->child()->descendant(),
280 279
             // Collateral relatives
281
-            Relationship::dynamic(fn (int $n) => $compound($n, 'grand-', 'tante', 'de la ', 'de la '))->ancestor()->sister(),
282
-            Relationship::dynamic(fn (int $n) => $compound($n, 'grand-', 'tante par alliance', 'de la ', 'de la '))->ancestor()->sibling()->wife(),
283
-            Relationship::dynamic(fn (int $n) => $compound($n, 'grand-', 'oncle', 'de l’', 'du '))->ancestor()->brother(),
284
-            Relationship::dynamic(fn (int $n) => $compound($n, 'grand-', 'oncle par alliance', 'de l’', 'du '))->ancestor()->sibling()->husband(),
285
-            Relationship::dynamic(fn (int $n) => $compound($n, 'petite-', 'nièce', 'de la ', 'de la '))->sibling()->descendant()->female(),
286
-            Relationship::dynamic(fn (int $n) => $compound($n, 'petite-', 'nièce par alliance', 'de la ', 'de la '))->married()->spouse()->sibling()->descendant()->female(),
287
-            Relationship::dynamic(fn (int $n) => $compound($n, 'petit-', 'neveu', 'du ', 'du '))->sibling()->descendant()->male(),
288
-            Relationship::dynamic(fn (int $n) => $compound($n, 'petit-', 'neveu par alliance', 'du ', 'du '))->married()->spouse()->sibling()->descendant()->male(),
280
+            Relationship::dynamic(fn(int $n) => $compound($n, 'grand-', 'tante', 'de la ', 'de la '))->ancestor()->sister(),
281
+            Relationship::dynamic(fn(int $n) => $compound($n, 'grand-', 'tante par alliance', 'de la ', 'de la '))->ancestor()->sibling()->wife(),
282
+            Relationship::dynamic(fn(int $n) => $compound($n, 'grand-', 'oncle', 'de l’', 'du '))->ancestor()->brother(),
283
+            Relationship::dynamic(fn(int $n) => $compound($n, 'grand-', 'oncle par alliance', 'de l’', 'du '))->ancestor()->sibling()->husband(),
284
+            Relationship::dynamic(fn(int $n) => $compound($n, 'petite-', 'nièce', 'de la ', 'de la '))->sibling()->descendant()->female(),
285
+            Relationship::dynamic(fn(int $n) => $compound($n, 'petite-', 'nièce par alliance', 'de la ', 'de la '))->married()->spouse()->sibling()->descendant()->female(),
286
+            Relationship::dynamic(fn(int $n) => $compound($n, 'petit-', 'neveu', 'du ', 'du '))->sibling()->descendant()->male(),
287
+            Relationship::dynamic(fn(int $n) => $compound($n, 'petit-', 'neveu par alliance', 'du ', 'du '))->married()->spouse()->sibling()->descendant()->male(),
289 288
             // Cousins (based on canon law)
290
-            Relationship::dynamic(fn (int $up, int $down) => $cousin($up, $down, 'F'))->cousin()->female(),
291
-            Relationship::dynamic(fn (int $up, int $down) => $cousin($up, $down, 'M'))->cousin()->male(),
289
+            Relationship::dynamic(fn(int $up, int $down) => $cousin($up, $down, 'F'))->cousin()->female(),
290
+            Relationship::dynamic(fn(int $up, int $down) => $cousin($up, $down, 'M'))->cousin()->male(),
292 291
 
293 292
         ];
294 293
     }
Please login to merge, or discard this patch.