Passed
Pull Request — main (#3985)
by Jonathan
20:03
created
app/Http/RequestHandlers/AddChildToIndividualPage.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@
 block discarded – undo
78 78
                 break;
79 79
         }
80 80
 
81
-        $name_facts = array_map(fn (string $gedcom): Fact => new Fact($gedcom, $dummy, ''), $names);
81
+        $name_facts = array_map(fn(string $gedcom): Fact => new Fact($gedcom, $dummy, ''), $names);
82 82
 
83 83
         $facts = [
84 84
             'i' => [
Please login to merge, or discard this patch.
app/Http/RequestHandlers/AddParentToIndividualPage.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -62,14 +62,14 @@
 block discarded – undo
62 62
         $individual = Auth::checkIndividualAccess($individual, true);
63 63
 
64 64
         // Create a dummy individual, so that we can create new/empty facts.
65
-        $dummy   = Registry::individualFactory()->new('', '0 @@ INDI', null, $tree);
65
+        $dummy = Registry::individualFactory()->new('', '0 @@ INDI', null, $tree);
66 66
 
67 67
         // Default names facts.
68 68
         $surname_tradition = SurnameTradition::create($tree->getPreference('SURNAME_TRADITION'));
69 69
         $names             = $surname_tradition->newParentNames($individual, $sex);
70
-        $name_facts        = array_map(fn (string $gedcom): Fact => new Fact($gedcom, $dummy, ''), $names);
70
+        $name_facts        = array_map(fn(string $gedcom): Fact => new Fact($gedcom, $dummy, ''), $names);
71 71
 
72
-        $facts   = [
72
+        $facts = [
73 73
             'i' => [
74 74
                 new Fact('1 SEX ' . $sex, $dummy, ''),
75 75
                 ...$name_facts,
Please login to merge, or discard this patch.
app/Http/RequestHandlers/AddChildToFamilyPage.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@
 block discarded – undo
67 67
         // Default names facts.
68 68
         $surname_tradition = SurnameTradition::create($tree->getPreference('SURNAME_TRADITION'));
69 69
         $names             = $surname_tradition->newChildNames($family->husband(), $family->wife(), $sex);
70
-        $name_facts        = array_map(fn (string $gedcom): Fact => new Fact($gedcom, $dummy, ''), $names);
70
+        $name_facts        = array_map(fn(string $gedcom): Fact => new Fact($gedcom, $dummy, ''), $names);
71 71
 
72 72
         $facts = [
73 73
             'i' => [
Please login to merge, or discard this patch.
app/Http/RequestHandlers/AddSpouseToIndividualPage.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -72,9 +72,9 @@
 block discarded – undo
72 72
         // Default names facts.
73 73
         $surname_tradition = SurnameTradition::create($tree->getPreference('SURNAME_TRADITION'));
74 74
         $names             = $surname_tradition->newSpouseNames($individual, $sex);
75
-        $name_facts        = array_map(fn (string $gedcom): Fact => new Fact($gedcom, $dummyi, ''), $names);
75
+        $name_facts        = array_map(fn(string $gedcom): Fact => new Fact($gedcom, $dummyi, ''), $names);
76 76
 
77
-        $facts   = [
77
+        $facts = [
78 78
             'i' => [
79 79
                 new Fact('1 SEX ' . $sex, $dummyi, ''),
80 80
                 ...$name_facts,
Please login to merge, or discard this patch.
app/Http/RequestHandlers/AddSpouseToFamilyPage.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@
 block discarded – undo
72 72
         $spouse            = $family->spouses()->first();
73 73
         assert($spouse instanceof Individual);
74 74
         $names      = $surname_tradition->newSpouseNames($spouse, $sex);
75
-        $name_facts = array_map(fn (string $gedcom): Fact => new Fact($gedcom, $dummyi, ''), $names);
75
+        $name_facts = array_map(fn(string $gedcom): Fact => new Fact($gedcom, $dummyi, ''), $names);
76 76
 
77 77
         $facts = [
78 78
             'i' => [
Please login to merge, or discard this patch.
app/SurnameTradition/DefaultSurnameTradition.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
         $parts = array_filter($parts);
125 125
 
126 126
         $parts = array_map(
127
-            fn (string $tag, string $value): string => "\n2 " . $tag . ' ' . $value,
127
+            fn(string $tag, string $value): string => "\n2 " . $tag . ' ' . $value,
128 128
             array_keys($parts),
129 129
             $parts
130 130
         );
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
         if ($individual instanceof Individual) {
149 149
             $fact = $individual
150 150
                 ->facts(['NAME'])
151
-                ->first(fn (Fact $fact): bool => in_array($fact->attribute('TYPE'), ['', 'birth', 'change'], true));
151
+                ->first(fn(Fact $fact): bool => in_array($fact->attribute('TYPE'), ['', 'birth', 'change'], true));
152 152
 
153 153
             if ($fact instanceof Fact) {
154 154
                 return $fact->value();
Please login to merge, or discard this patch.
app/Http/RequestHandlers/EditFactPage.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
         $record = Auth::checkRecordAccess($record, true);
75 75
 
76 76
         // Find the fact to edit
77
-        $fact = $record->facts()->first(fn (Fact $fact): bool => $fact->id() === $fact_id && $fact->canEdit());
77
+        $fact = $record->facts()->first(fn(Fact $fact): bool => $fact->id() === $fact_id && $fact->canEdit());
78 78
 
79 79
         if ($fact === null) {
80 80
             return redirect($record->url());
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
             ]);
99 99
         }
100 100
 
101
-        $title  = $record->fullName() . ' - ' . $fact->label();
101
+        $title = $record->fullName() . ' - ' . $fact->label();
102 102
 
103 103
         return $this->viewResponse('edit/edit-fact', [
104 104
             'can_edit_raw' => $can_edit_raw,
Please login to merge, or discard this patch.
app/Elements/AgeAtEvent.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -75,13 +75,13 @@
 block discarded – undo
75 75
         $canonical = $this->canonical($value);
76 76
 
77 77
         return preg_replace_callback_array([
78
-            '/CHILD/'     => fn () => I18N::translate('Child'),
79
-            '/INFANT/'    => fn () => I18N::translate('Infant'),
80
-            '/STILLBORN/' => fn () => I18N::translate('Stillborn'),
81
-            '/\b(\d+)y\b/' => fn (array $match) => I18N::plural('%s year', '%s years', (int) ($match[1]), I18N::number((float) $match[1])),
82
-            '/\b(\d+)m\b/' => fn (array $match) => I18N::plural('%s month', '%s months', (int) ($match[1]), I18N::number((float) $match[1])),
83
-            '/\b(\d+)w\b/' => fn (array $match) => I18N::plural('%s week', '%s weeks', (int) ($match[1]), I18N::number((float) $match[1])),
84
-            '/\b(\d+)d\b/' => fn (array $match) => I18N::plural('%s day', '%s days', (int) ($match[1]), I18N::number((float) $match[1])),
78
+            '/CHILD/'     => fn() => I18N::translate('Child'),
79
+            '/INFANT/'    => fn() => I18N::translate('Infant'),
80
+            '/STILLBORN/' => fn() => I18N::translate('Stillborn'),
81
+            '/\b(\d+)y\b/' => fn(array $match) => I18N::plural('%s year', '%s years', (int) ($match[1]), I18N::number((float) $match[1])),
82
+            '/\b(\d+)m\b/' => fn(array $match) => I18N::plural('%s month', '%s months', (int) ($match[1]), I18N::number((float) $match[1])),
83
+            '/\b(\d+)w\b/' => fn(array $match) => I18N::plural('%s week', '%s weeks', (int) ($match[1]), I18N::number((float) $match[1])),
84
+            '/\b(\d+)d\b/' => fn(array $match) => I18N::plural('%s day', '%s days', (int) ($match[1]), I18N::number((float) $match[1])),
85 85
         ], e($canonical));
86 86
     }
87 87
 }
Please login to merge, or discard this patch.
app/Module/IndividualFactsTabModule.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -120,17 +120,17 @@
 block discarded – undo
120 120
         // Which facts and events are handled by other modules?
121 121
         $sidebar_facts = $this->module_service
122 122
             ->findByComponent(ModuleSidebarInterface::class, $individual->tree(), Auth::user())
123
-            ->map(fn (ModuleSidebarInterface $sidebar): Collection => $sidebar->supportedFacts());
123
+            ->map(fn(ModuleSidebarInterface $sidebar): Collection => $sidebar->supportedFacts());
124 124
 
125 125
         $tab_facts = $this->module_service
126 126
             ->findByComponent(ModuleTabInterface::class, $individual->tree(), Auth::user())
127
-            ->map(fn (ModuleTabInterface $tab): Collection => $tab->supportedFacts());
127
+            ->map(fn(ModuleTabInterface $tab): Collection => $tab->supportedFacts());
128 128
 
129 129
         $exclude_facts = $sidebar_facts->merge($tab_facts)->flatten();
130 130
 
131 131
         // The individual’s own facts
132 132
         $individual_facts = $individual->facts()
133
-            ->filter(fn (Fact $fact): bool => !$exclude_facts->contains($fact->tag()));
133
+            ->filter(fn(Fact $fact): bool => !$exclude_facts->contains($fact->tag()));
134 134
 
135 135
         $relative_facts = new Collection();
136 136
 
Please login to merge, or discard this patch.