Passed
Pull Request — main (#3887)
by Rico
06:03
created
app/I18N.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -326,7 +326,7 @@
 block discarded – undo
326 326
 
327 327
             self::$language = $module_service
328 328
                 ->findByInterface(ModuleLanguageInterface::class)
329
-                ->first(fn (ModuleLanguageInterface $module): bool => $module->locale()->languageTag() === $code);
329
+                ->first(fn(ModuleLanguageInterface $module): bool => $module->locale()->languageTag() === $code);
330 330
         }
331 331
 
332 332
         // Create a translator
Please login to merge, or discard this patch.
app/Module/LanguageFrench.php 1 patch
Spacing   +31 added lines, -32 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
 
@@ -104,20 +104,20 @@  discard block
 block discarded – undo
104 104
      */
105 105
     public function relationships(): array
106 106
     {
107
-        $genitive = fn (string $s, string $genitive_link): array => [$s, '%s ' . $genitive_link . $s];
107
+        $genitive = fn(string $s, string $genitive_link): array => [$s, '%s ' . $genitive_link . $s];
108 108
 
109
-        $great = fn (int $n, string $suffix, string $genitive_link): array => $genitive(
109
+        $great = fn(int $n, string $suffix, string $genitive_link): array => $genitive(
110 110
             ($n > 2 ? 'arrière-(x' . $n . ')-' : str_repeat('arrière-', max($n, 0))) . $suffix,
111 111
             $n === 0 ? $genitive_link : 'de l’'
112 112
         );
113 113
 
114 114
         $compoundgreat =
115
-            fn (int $n, string $first_level, string $suffix, string $genitive_none, string $genitive_first): array =>
115
+            fn(int $n, string $first_level, string $suffix, string $genitive_none, string $genitive_first): array =>
116 116
                 $great($n - 1, ($n > 0 ? $first_level : '') . $suffix, $n === 0 ? $genitive_none : $genitive_first);
117 117
 
118
-        $symmetricCousin = fn (int $n, string $sex): array => self::SYMMETRIC_COUSINS[$n][$sex] ?? $genitive(
118
+        $symmetricCousin = fn(int $n, string $sex): array => self::SYMMETRIC_COUSINS[$n][$sex] ?? $genitive(
119 119
             $sex === 'F' ? 'cousine au ' . $n . '<sup>e</sup> degré' : 'cousin au ' . $n . '<sup>e</sup> degré',
120
-            $sex === 'F'  ? 'de la ' : 'du '
120
+            $sex === 'F' ? 'de la ' : 'du '
121 121
         );
122 122
 
123 123
         $asymmetricCousin =
@@ -132,9 +132,8 @@  discard block
 block discarded – undo
132 132
                 }
133 133
                 return $genitive(
134 134
                     $sex === 'F' ?
135
-                        'cousine du ' . $down . '<sup>e</sup> au ' . $up . '<sup>e</sup> degré' :
136
-                        'cousin du ' . $down . '<sup>e</sup> au ' . $up . '<sup>e</sup> degré',
137
-                    $sex === 'F'  ? 'de la ' : 'du '
135
+                        'cousine du ' . $down . '<sup>e</sup> au ' . $up . '<sup>e</sup> degré' : 'cousin du ' . $down . '<sup>e</sup> au ' . $up . '<sup>e</sup> degré',
136
+                    $sex === 'F' ? 'de la ' : 'du '
138 137
                 );
139 138
             };
140 139
 
@@ -212,31 +211,31 @@  discard block
 block discarded – undo
212 211
             Relationship::fixed('beau-frère', '%s du beau-frère')->sibling()->husband(),
213 212
             Relationship::fixed('beau-frère/belle-sœur', '%s du beau-frère/belle-sœur')->sibling()->spouse(),
214 213
             // Grandparents and above
215
-            Relationship::dynamic(fn (int $n) => $great($n - 1, 'grand-mère maternelle', 'de la '))->mother()->ancestor()->female(),
216
-            Relationship::dynamic(fn (int $n) => $great($n - 1, 'grand-père maternel', 'du '))->mother()->ancestor()->male(),
217
-            Relationship::dynamic(fn (int $n) => $great($n - 1, 'grand-mère paternelle', 'de la '))->father()->ancestor()->female(),
218
-            Relationship::dynamic(fn (int $n) => $great($n - 1, 'grand-père paternel', 'du '))->father()->ancestor()->male(),
219
-            Relationship::dynamic(fn (int $n) => $great($n - 2, 'grand-mère', 'de la '))->ancestor()->female(),
220
-            Relationship::dynamic(fn (int $n) => $great($n - 2, 'grand-père', 'du '))->ancestor()->male(),
221
-            Relationship::dynamic(fn (int $n) => $great($n - 2, 'grand-parent', 'du '))->ancestor(),
214
+            Relationship::dynamic(fn(int $n) => $great($n - 1, 'grand-mère maternelle', 'de la '))->mother()->ancestor()->female(),
215
+            Relationship::dynamic(fn(int $n) => $great($n - 1, 'grand-père maternel', 'du '))->mother()->ancestor()->male(),
216
+            Relationship::dynamic(fn(int $n) => $great($n - 1, 'grand-mère paternelle', 'de la '))->father()->ancestor()->female(),
217
+            Relationship::dynamic(fn(int $n) => $great($n - 1, 'grand-père paternel', 'du '))->father()->ancestor()->male(),
218
+            Relationship::dynamic(fn(int $n) => $great($n - 2, 'grand-mère', 'de la '))->ancestor()->female(),
219
+            Relationship::dynamic(fn(int $n) => $great($n - 2, 'grand-père', 'du '))->ancestor()->male(),
220
+            Relationship::dynamic(fn(int $n) => $great($n - 2, 'grand-parent', 'du '))->ancestor(),
222 221
             // Grandchildren and below
223
-            Relationship::dynamic(fn (int $n) => $great($n - 2, 'petite-fille', 'de la '))->descendant()->female(),
224
-            Relationship::dynamic(fn (int $n) => $great($n - 2, 'petit-fils', 'du '))->descendant()->male(),
225
-            Relationship::dynamic(fn (int $n) => $great($n - 2, 'petit-enfant', 'du'))->descendant(),
222
+            Relationship::dynamic(fn(int $n) => $great($n - 2, 'petite-fille', 'de la '))->descendant()->female(),
223
+            Relationship::dynamic(fn(int $n) => $great($n - 2, 'petit-fils', 'du '))->descendant()->male(),
224
+            Relationship::dynamic(fn(int $n) => $great($n - 2, 'petit-enfant', 'du'))->descendant(),
226 225
             // Collateral relatives
227
-            Relationship::dynamic(fn (int $n) => $compoundgreat($n - 1, 'grand-', 'tante', 'de la ', 'de la '))->ancestor()->sister(),
228
-            Relationship::dynamic(fn (int $n) => $compoundgreat($n - 1, 'grand-', 'tante par alliance', 'de la ', 'de la '))->ancestor()->sibling()->wife(),
229
-            Relationship::dynamic(fn (int $n) => $compoundgreat($n - 1, 'grand-', 'oncle', 'de l’', 'du '))->ancestor()->brother(),
230
-            Relationship::dynamic(fn (int $n) => $compoundgreat($n - 1, 'grand-', 'oncle par alliance', 'de l’', 'du '))->ancestor()->sibling()->husband(),
231
-            Relationship::dynamic(fn (int $n) => $compoundgreat($n - 1, 'petite-', 'nièce', 'de la ', 'de la '))->sibling()->descendant()->female(),
232
-            Relationship::dynamic(fn (int $n) => $compoundgreat($n - 1, 'petite-', 'nièce par alliance', 'de la ', 'de la '))->married()->spouse()->sibling()->descendant()->female(),
233
-            Relationship::dynamic(fn (int $n) => $compoundgreat($n - 1, 'petit-', 'neveu', 'du ', 'du '))->sibling()->descendant()->male(),
234
-            Relationship::dynamic(fn (int $n) => $compoundgreat($n - 1, 'petit-', 'neveu par alliance', 'du ', 'du '))->married()->spouse()->sibling()->descendant()->male(),
226
+            Relationship::dynamic(fn(int $n) => $compoundgreat($n - 1, 'grand-', 'tante', 'de la ', 'de la '))->ancestor()->sister(),
227
+            Relationship::dynamic(fn(int $n) => $compoundgreat($n - 1, 'grand-', 'tante par alliance', 'de la ', 'de la '))->ancestor()->sibling()->wife(),
228
+            Relationship::dynamic(fn(int $n) => $compoundgreat($n - 1, 'grand-', 'oncle', 'de l’', 'du '))->ancestor()->brother(),
229
+            Relationship::dynamic(fn(int $n) => $compoundgreat($n - 1, 'grand-', 'oncle par alliance', 'de l’', 'du '))->ancestor()->sibling()->husband(),
230
+            Relationship::dynamic(fn(int $n) => $compoundgreat($n - 1, 'petite-', 'nièce', 'de la ', 'de la '))->sibling()->descendant()->female(),
231
+            Relationship::dynamic(fn(int $n) => $compoundgreat($n - 1, 'petite-', 'nièce par alliance', 'de la ', 'de la '))->married()->spouse()->sibling()->descendant()->female(),
232
+            Relationship::dynamic(fn(int $n) => $compoundgreat($n - 1, 'petit-', 'neveu', 'du ', 'du '))->sibling()->descendant()->male(),
233
+            Relationship::dynamic(fn(int $n) => $compoundgreat($n - 1, 'petit-', 'neveu par alliance', 'du ', 'du '))->married()->spouse()->sibling()->descendant()->male(),
235 234
             // Cousins (based on canon law)
236
-            Relationship::dynamic(fn (int $n) => $symmetricCousin($n, 'F'))->symmetricCousin()->female(),
237
-            Relationship::dynamic(fn (int $n) => $symmetricCousin($n, 'M'))->symmetricCousin()->male(),
238
-            Relationship::dynamic(fn (int $up, int $down) => $asymmetricCousin($up, $down, 'F'))->cousin()->female(),
239
-            Relationship::dynamic(fn (int $up, int $down) => $asymmetricCousin($up, $down, 'M'))->cousin()->male(),
235
+            Relationship::dynamic(fn(int $n) => $symmetricCousin($n, 'F'))->symmetricCousin()->female(),
236
+            Relationship::dynamic(fn(int $n) => $symmetricCousin($n, 'M'))->symmetricCousin()->male(),
237
+            Relationship::dynamic(fn(int $up, int $down) => $asymmetricCousin($up, $down, 'F'))->cousin()->female(),
238
+            Relationship::dynamic(fn(int $up, int $down) => $asymmetricCousin($up, $down, 'M'))->cousin()->male(),
240 239
 
241 240
         ];
242 241
     }
Please login to merge, or discard this patch.
app/Services/ModuleService.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -746,7 +746,7 @@  discard block
 block discarded – undo
746 746
         } catch (Throwable $exception) {
747 747
             $module_name = basename(dirname($filename));
748 748
             $message     = 'Fatal error in module: ' . $module_name;
749
-            $message     .= '<br>' . $exception;
749
+            $message .= '<br>' . $exception;
750 750
             FlashMessages::addMessage($message, 'danger');
751 751
         }
752 752
 
@@ -874,7 +874,7 @@  discard block
 block discarded – undo
874 874
     public function findByName(string $module_name, bool $include_disabled = false): ?ModuleInterface
875 875
     {
876 876
         return $this->all($include_disabled)
877
-            ->first(static function (ModuleInterface $module) use ($module_name): bool {
877
+            ->first(static function (ModuleInterface $module) use ($module_name) : bool {
878 878
                 return $module->name() === $module_name;
879 879
             });
880 880
     }
Please login to merge, or discard this patch.
app/Module/ModuleMapGeoLocationTrait.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -109,7 +109,7 @@
 block discarded – undo
109 109
         try {
110 110
             $results = json_decode($body, false, JSON_THROW_ON_ERROR);
111 111
 
112
-            $results = array_map(fn () => '', $results);
112
+            $results = array_map(fn() => '', $results);
113 113
 
114 114
             return [];
115 115
         } catch (JsonException $ex) {
Please login to merge, or discard this patch.
app/Module/PlaceHierarchyListModule.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -212,14 +212,14 @@
 block discarded – undo
212 212
             default:
213 213
                 $alt_link = I18N::translate('Show place hierarchy');
214 214
                 $alt_url  = $this->listUrl($tree, ['action2' => 'hierarchy', 'place_id' => $place_id]);
215
-                $content  .= view('modules/place-hierarchy/list', ['columns' => $this->getList($tree)]);
215
+                $content .= view('modules/place-hierarchy/list', ['columns' => $this->getList($tree)]);
216 216
                 break;
217 217
             case 'hierarchy':
218 218
             case 'hierarchy-e':
219 219
                 $alt_link = I18N::translate('Show all places in a list');
220 220
                 $alt_url  = $this->listUrl($tree, ['action2' => 'list', 'place_id' => 0]);
221 221
                 $data     = $this->getHierarchy($place);
222
-                $content  .= (null === $data || $showmap) ? '' : view('place-hierarchy', $data);
222
+                $content .= (null === $data || $showmap) ? '' : view('place-hierarchy', $data);
223 223
                 if (null === $data || $action2 === 'hierarchy-e') {
224 224
                     $content .= view('modules/place-hierarchy/events', [
225 225
                         'indilist' => $this->search_service->searchIndividualsInPlace($place),
Please login to merge, or discard this patch.
app/Module/ModuleMapAutocompleteTrait.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@
 block discarded – undo
66 66
         } catch (RequestException $ex) {
67 67
             // Service down?  Quota exceeded?
68 68
             // Don't try for another hour.
69
-            $cache->remember($key, fn () => [], 3600);
69
+            $cache->remember($key, fn() => [], 3600);
70 70
 
71 71
             return [];
72 72
         }
Please login to merge, or discard this patch.
app/Module/ShareAnniversaryModule.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
     {
101 101
         if ($record instanceof Individual) {
102 102
             $facts = $record->facts(static::INDIVIDUAL_EVENTS, true)
103
-                ->merge($record->spouseFamilies()->map(fn (Family $family): Collection => $family->facts(static::FAMILY_EVENTS, true)));
103
+                ->merge($record->spouseFamilies()->map(fn(Family $family): Collection => $family->facts(static::FAMILY_EVENTS, true)));
104 104
         } elseif ($record instanceof Family) {
105 105
             $facts = $record->facts(static::FAMILY_EVENTS, true);
106 106
         } else {
@@ -110,11 +110,11 @@  discard block
 block discarded – undo
110 110
         // iCalendar only supports exact Gregorian dates.
111 111
         $facts = $facts
112 112
             ->flatten()
113
-            ->filter(fn (Fact $fact): bool => $fact->date()->isOK())
114
-            ->filter(fn (Fact $fact): bool => $fact->date()->qual1 === '')
115
-            ->filter(fn (Fact $fact): bool => $fact->date()->minimumDate() instanceof GregorianDate)
116
-            ->filter(fn (Fact $fact): bool => $fact->date()->minimumJulianDay() === $fact->date()->maximumJulianDay())
117
-            ->mapWithKeys(fn (Fact $fact): array => [
113
+            ->filter(fn(Fact $fact): bool => $fact->date()->isOK())
114
+            ->filter(fn(Fact $fact): bool => $fact->date()->qual1 === '')
115
+            ->filter(fn(Fact $fact): bool => $fact->date()->minimumDate() instanceof GregorianDate)
116
+            ->filter(fn(Fact $fact): bool => $fact->date()->minimumJulianDay() === $fact->date()->maximumJulianDay())
117
+            ->mapWithKeys(fn(Fact $fact): array => [
118 118
                 route(static::class, ['tree' => $record->tree()->name(), 'xref' => $fact->record()->xref(), 'fact_id' => $fact->id()]) =>
119 119
                     $fact->label() . ' — ' . $fact->date()->display(false, null, false),
120 120
             ]);
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
         $record = Auth::checkRecordAccess($record);
150 150
 
151 151
         $fact = $record->facts()
152
-            ->filter(fn (Fact $fact): bool => $fact->id() === $fact_id)
152
+            ->filter(fn(Fact $fact): bool => $fact->id() === $fact_id)
153 153
             ->first();
154 154
 
155 155
         if ($fact instanceof Fact) {
Please login to merge, or discard this patch.
app/Services/RelationshipService.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@
 block discarded – undo
76 76
     {
77 77
         $language = app(ModuleService::class)
78 78
             ->findByInterface(ModuleLanguageInterface::class, true)
79
-            ->first(fn (ModuleLanguageInterface $language): bool => $language->locale()->languageTag() === I18N::languageTag());
79
+            ->first(fn(ModuleLanguageInterface $language) : bool => $language->locale()->languageTag() === I18N::languageTag());
80 80
 
81 81
         $path = $this->getCloseRelationship($individual1, $individual2);
82 82
 
Please login to merge, or discard this patch.
app/Elements/AbstractElement.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -119,7 +119,7 @@
 block discarded – undo
119 119
             }
120 120
 
121 121
             // We may use markup to display values, but not when editing them.
122
-            $values = array_map(fn (string $x): string => strip_tags($x), $values);
122
+            $values = array_map(fn(string $x): string => strip_tags($x), $values);
123 123
 
124 124
             return view('components/select', [
125 125
                 'id'       => $id,
Please login to merge, or discard this patch.