Passed
Push — validation ( 1c78f5...5db15e )
by Greg
08:11
created
app/Validator.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
      */
93 93
     public function isBetween(int $minimum, int $maximum): self
94 94
     {
95
-        $this->rules[] = static function (?int $value) use ($minimum, $maximum): ?int {
95
+        $this->rules[] = static function (?int $value) use ($minimum, $maximum) : ?int {
96 96
             if (is_int($value) && $value >= $minimum && $value <= $maximum) {
97 97
                 return $value;
98 98
             }
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
      */
111 111
     public function isInArray(array $values): self
112 112
     {
113
-        $this->rules[] = static fn (?string $value): ?string => is_string($value) && in_array($value, $values, true) ? $value : null;
113
+        $this->rules[] = static fn(?string $value) : ?string => is_string($value) && in_array($value, $values, true) ? $value : null;
114 114
 
115 115
         return $this;
116 116
     }
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
      */
122 122
     public function isLocalUrl(string $base_url): self
123 123
     {
124
-        $this->rules[] = static function (?string $value) use ($base_url): ?string {
124
+        $this->rules[] = static function (?string $value) use ($base_url) : ?string {
125 125
             if (is_string($value)) {
126 126
                 $value_info    = parse_url($value);
127 127
                 $base_url_info = parse_url($base_url);
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
             $value = null;
195 195
         }
196 196
 
197
-        $callback = static fn (?array $value, Closure $rule): ?array => $rule($value);
197
+        $callback = static fn(?array $value, Closure $rule) : ?array => $rule($value);
198 198
 
199 199
         return array_reduce($this->rules, $callback, $value);
200 200
     }
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
             $value = null;
215 215
         }
216 216
 
217
-        $callback = static fn (?int $value, Closure $rule): ?int => $rule($value);
217
+        $callback = static fn(?int $value, Closure $rule) : ?int => $rule($value);
218 218
 
219 219
         return array_reduce($this->rules, $callback, $value);
220 220
     }
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
             $value = null;
233 233
         }
234 234
 
235
-        $callback = static fn (?string $value, Closure $rule): ?string => $rule($value);
235
+        $callback = static fn(?string $value, Closure $rule) : ?string => $rule($value);
236 236
 
237 237
         return array_reduce($this->rules, $callback, $value);
238 238
     }
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
             $value = null;
277 277
         }
278 278
 
279
-        $callback = static fn (?array $value, Closure $rule): ?array => $rule($value);
279
+        $callback = static fn(?array $value, Closure $rule) : ?array => $rule($value);
280 280
 
281 281
         $value = array_reduce($this->rules, $callback, $value);
282 282
 
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
             $value = null;
306 306
         }
307 307
 
308
-        $callback = static fn (?int $value, Closure $rule): ?int => $rule($value);
308
+        $callback = static fn(?int $value, Closure $rule) : ?int => $rule($value);
309 309
 
310 310
         $value = array_reduce($this->rules, $callback, $value);
311 311
 
@@ -348,9 +348,9 @@  discard block
 block discarded – undo
348 348
             $value = null;
349 349
         }
350 350
 
351
-        $callback = static fn (?string $value, Closure $rule): ?string => $rule($value);
351
+        $callback = static fn(?string $value, Closure $rule) : ?string => $rule($value);
352 352
 
353
-        $value =  array_reduce($this->rules, $callback, $value);
353
+        $value = array_reduce($this->rules, $callback, $value);
354 354
         $value ??= $default;
355 355
 
356 356
         if ($value === null) {
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(),
120 120
             ]);
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
         $record  = Auth::checkRecordAccess($record);
147 147
 
148 148
         $fact = $record->facts()
149
-            ->filter(fn (Fact $fact): bool => $fact->id() === $fact_id)
149
+            ->filter(fn(Fact $fact): bool => $fact->id() === $fact_id)
150 150
             ->first();
151 151
 
152 152
         if ($fact instanceof Fact) {
Please login to merge, or discard this patch.
app/Statistics/Repository/IndividualRepository.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -588,7 +588,7 @@
 block discarded – undo
588 588
 
589 589
         $module = $module_service
590 590
             ->findByComponent(ModuleListInterface::class, $this->tree, Auth::user())
591
-            ->first(static fn (ModuleInterface $module): bool => $module instanceof IndividualListModule);
591
+            ->first(static fn(ModuleInterface $module): bool => $module instanceof IndividualListModule);
592 592
 
593 593
         if ($type === 'list') {
594 594
             return view('lists/surnames-bullet-list', [
Please login to merge, or discard this patch.
app/Module/ModuleThemeTrait.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -397,7 +397,7 @@  discard block
 block discarded – undo
397 397
 
398 398
         $pedigree_chart = $module_service
399 399
             ->findByComponent(ModuleChartInterface::class, $tree, Auth::user())
400
-            ->first(static fn (ModuleInterface $module): bool => $module instanceof PedigreeChartModule);
400
+            ->first(static fn(ModuleInterface $module): bool => $module instanceof PedigreeChartModule);
401 401
 
402 402
         if ($my_xref !== '' && $pedigree_chart instanceof PedigreeChartModule) {
403 403
             $individual = Registry::individualFactory()->make($my_xref, $tree);
@@ -486,7 +486,7 @@  discard block
 block discarded – undo
486 486
 
487 487
         return $module_service
488 488
             ->findByComponent(ModuleMenuInterface::class, $tree, Auth::user())
489
-            ->map(static fn (ModuleMenuInterface $menu): ?Menu => $menu->getMenu($tree))
489
+            ->map(static fn(ModuleMenuInterface $menu): ?Menu => $menu->getMenu($tree))
490 490
             ->filter()
491 491
             ->all();
492 492
     }
Please login to merge, or discard this patch.
app/Module/FamilyTreeStatisticsModule.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -145,7 +145,7 @@
 block discarded – undo
145 145
             // Find a module providing individual lists
146 146
             $module = $this->module_service
147 147
                 ->findByComponent(ModuleListInterface::class, $tree, Auth::user())
148
-                ->first(static fn (ModuleInterface $module): bool => $module instanceof IndividualListModule);
148
+                ->first(static fn(ModuleInterface $module): bool => $module instanceof IndividualListModule);
149 149
 
150 150
             $surnames = view('lists/surnames-compact-list', [
151 151
                 'module'   => $module,
Please login to merge, or discard this patch.
app/Module/RelationshipsChartModule.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -328,7 +328,7 @@
 block discarded – undo
328 328
 
329 329
             $language = $this->module_service
330 330
                 ->findByInterface(ModuleLanguageInterface::class, true)
331
-                ->first(fn (ModuleLanguageInterface $language): bool => $language->locale()->languageTag() === I18N::languageTag());
331
+                ->first(fn(ModuleLanguageInterface $language): bool => $language->locale()->languageTag() === I18N::languageTag());
332 332
 
333 333
             echo '<h3>', I18N::translate('Relationship: %s', $this->relationship_service->nameFromPath($nodes->all(), $language)), '</h3>';
334 334
             $num_paths++;
Please login to merge, or discard this patch.