Passed
Pull Request — main (#4228)
by David
07:34
created
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
             ]);
@@ -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/Http/RequestHandlers/AddSpouseToFamilyPage.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@
 block discarded – undo
79 79
         $surname_tradition = SurnameTradition::create($tree->getPreference('SURNAME_TRADITION'));
80 80
         $spouse            = $family->spouses()->first();
81 81
         assert($spouse instanceof Individual);
82
-        $names      = $surname_tradition->newSpouseNames($spouse, $sex);
82
+        $names = $surname_tradition->newSpouseNames($spouse, $sex);
83 83
 
84 84
         $facts = [
85 85
             'i' => $this->gedcom_edit_service->newIndividualFacts($tree, $sex, $names),
Please login to merge, or discard this patch.
app/Services/GedcomEditService.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
     {
69 69
         $dummy = Registry::familyFactory()->new('', '0 @@ FAM', null, $tree);
70 70
         $tags  = new Collection(explode(',', $tree->getPreference('QUICK_REQUIRED_FAMFACTS')));
71
-        $facts = $tags->map(fn (string $tag): Fact => $this->createNewFact($dummy, $tag));
71
+        $facts = $tags->map(fn(string $tag): Fact => $this->createNewFact($dummy, $tag));
72 72
 
73 73
         return Fact::sortFacts($facts);
74 74
     }
@@ -84,9 +84,9 @@  discard block
 block discarded – undo
84 84
     {
85 85
         $dummy      = Registry::individualFactory()->new('', '0 @@ INDI', null, $tree);
86 86
         $tags       = new Collection(explode(',', $tree->getPreference('QUICK_REQUIRED_FACTS')));
87
-        $facts      = $tags->map(fn (string $tag): Fact => $this->createNewFact($dummy, $tag));
87
+        $facts      = $tags->map(fn(string $tag): Fact => $this->createNewFact($dummy, $tag));
88 88
         $sex_fact   = new Collection([new Fact('1 SEX ' . $sex, $dummy, '')]);
89
-        $name_facts = Collection::make($names)->map(static fn (string $gedcom): Fact => new Fact($gedcom, $dummy, ''));
89
+        $name_facts = Collection::make($names)->map(static fn(string $gedcom): Fact => new Fact($gedcom, $dummy, ''));
90 90
 
91 91
         return $sex_fact->concat($name_facts)->concat(Fact::sortFacts($facts));
92 92
     }
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
                 }
153 153
             }
154 154
 
155
-            if ($values[$i] !== '' || $children_with_values  && !$element instanceof AbstractXrefElement) {
155
+            if ($values[$i] !== '' || $children_with_values && !$element instanceof AbstractXrefElement) {
156 156
                 if ($values[$i] === '') {
157 157
                     $gedcom_lines[] = $levels[$i] . ' ' . $tags[$i];
158 158
                 } else {
@@ -218,15 +218,15 @@  discard block
 block discarded – undo
218 218
     {
219 219
         $subtags = Registry::elementFactory()->make($record->tag())->subtags();
220 220
 
221
-        $subtags = array_filter($subtags, static fn (string $v, string $k) => !str_ends_with($v, ':1') || $record->facts([$k])->isEmpty(), ARRAY_FILTER_USE_BOTH);
221
+        $subtags = array_filter($subtags, static fn(string $v, string $k) => !str_ends_with($v, ':1') || $record->facts([$k])->isEmpty(), ARRAY_FILTER_USE_BOTH);
222 222
 
223 223
         $subtags = array_keys($subtags);
224 224
 
225 225
         // Don't include facts/events that we have hidden in the control panel.
226
-        $subtags = array_filter($subtags, fn (string $subtag): bool => !$this->isHiddenTag($record->tag() . ':' . $subtag));
226
+        $subtags = array_filter($subtags, fn(string $subtag): bool => !$this->isHiddenTag($record->tag() . ':' . $subtag));
227 227
 
228 228
         if (!$include_hidden) {
229
-            $fn_hidden = fn (string $t): bool => !$this->isHiddenTag($record->tag() . ':' . $t);
229
+            $fn_hidden = fn(string $t): bool => !$this->isHiddenTag($record->tag() . ':' . $t);
230 230
             $subtags   = array_filter($subtags, $fn_hidden);
231 231
         }
232 232
 
@@ -317,7 +317,7 @@  discard block
 block discarded – undo
317 317
     private function isHiddenTag(string $tag): bool
318 318
     {
319 319
         // Function to filter hidden tags.
320
-        $fn_hide = static fn (string $x): bool => (bool) Site::getPreference('HIDE_' . $x);
320
+        $fn_hide = static fn(string $x): bool => (bool) Site::getPreference('HIDE_' . $x);
321 321
 
322 322
         $preferences = array_filter(Gedcom::HIDDEN_TAGS, $fn_hide, ARRAY_FILTER_USE_KEY);
323 323
         $preferences = array_values($preferences);
Please login to merge, or discard this patch.
app/Module/IndividualMetadataModule.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
     public function getSidebarContent(Individual $individual): string
102 102
     {
103 103
         $html = $individual->facts(static::HANDLED_FACTS)
104
-            ->map(static fn (Fact $fact): string =>view('fact', ['fact' => $fact, 'record' => $individual]))
104
+            ->map(static fn(Fact $fact): string =>view('fact', ['fact' => $fact, 'record' => $individual]))
105 105
             ->implode('');
106 106
 
107 107
         return strip_tags($html, '<a><div><span><i>');
@@ -114,6 +114,6 @@  discard block
 block discarded – undo
114 114
      */
115 115
     public function supportedFacts(): Collection
116 116
     {
117
-        return new Collection(array_map(static fn (string $tag): string => 'INDI:' . $tag, static::HANDLED_FACTS));
117
+        return new Collection(array_map(static fn(string $tag): string => 'INDI:' . $tag, static::HANDLED_FACTS));
118 118
     }
119 119
 }
Please login to merge, or discard this patch.
app/Module/NotesTabModule.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -142,7 +142,7 @@
 block discarded – undo
142 142
                 }
143 143
             }
144 144
 
145
-            $callback = static fn (Fact $fact): bool => preg_match('/(?:^1|\n\d) NOTE/', $fact->gedcom()) === 1;
145
+            $callback = static fn(Fact $fact): bool => preg_match('/(?:^1|\n\d) NOTE/', $fact->gedcom()) === 1;
146 146
 
147 147
             $this->facts = $facts->filter($callback);
148 148
 
Please login to merge, or discard this patch.
app/Elements/NoteStructure.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -130,9 +130,9 @@
 block discarded – undo
130 130
 
131 131
         if ($one_line_only) {
132 132
             return
133
-                 '<div class="fact_NOTE">' .
134
-                 I18N::translate('<span class="label">%1$s:</span> <span class="field" dir="auto">%2$s</span>', $label, $html) .
135
-                 '</div>';
133
+                    '<div class="fact_NOTE">' .
134
+                    I18N::translate('<span class="label">%1$s:</span> <span class="field" dir="auto">%2$s</span>', $label, $html) .
135
+                    '</div>';
136 136
         }
137 137
 
138 138
         return
Please login to merge, or discard this patch.
app/Validator.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
      */
81 81
     public function isBetween(int $minimum, int $maximum): self
82 82
     {
83
-        $this->rules[] = static function (?int $value) use ($minimum, $maximum): ?int {
83
+        $this->rules[] = static function (?int $value) use ($minimum, $maximum) : ?int {
84 84
             if (is_int($value) && $value >= $minimum && $value <= $maximum) {
85 85
                 return $value;
86 86
             }
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
      */
99 99
     public function isInArray(array $values): self
100 100
     {
101
-        $this->rules[] = static fn (?string $value): ?string => is_string($value) && in_array($value, $values, true) ? $value : null;
101
+        $this->rules[] = static fn(?string $value) : ?string => is_string($value) && in_array($value, $values, true) ? $value : null;
102 102
 
103 103
         return $this;
104 104
     }
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
      */
110 110
     public function isLocalUrl(string $base_url): self
111 111
     {
112
-        $this->rules[] = static function (?string $value) use ($base_url): ?string {
112
+        $this->rules[] = static function (?string $value) use ($base_url) : ?string {
113 113
             if (is_string($value)) {
114 114
                 $value_info    = parse_url($value);
115 115
                 $base_url_info = parse_url($base_url);
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
             $value = null;
167 167
         }
168 168
 
169
-        $callback = static fn (?array $value, Closure $rule): ?array => $rule($value);
169
+        $callback = static fn(?array $value, Closure $rule) : ?array => $rule($value);
170 170
 
171 171
         return array_reduce($this->rules, $callback, $value);
172 172
     }
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
             $value = null;
187 187
         }
188 188
 
189
-        $callback = static fn (?int $value, Closure $rule): ?int => $rule($value);
189
+        $callback = static fn(?int $value, Closure $rule) : ?int => $rule($value);
190 190
 
191 191
         return array_reduce($this->rules, $callback, $value);
192 192
     }
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
             $value = null;
205 205
         }
206 206
 
207
-        $callback = static fn (?string $value, Closure $rule): ?string => $rule($value);
207
+        $callback = static fn(?string $value, Closure $rule) : ?string => $rule($value);
208 208
 
209 209
         return array_reduce($this->rules, $callback, $value);
210 210
     }
Please login to merge, or discard this patch.
app/Encodings/UTF8.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -828,7 +828,7 @@
 block discarded – undo
828 828
     public static function chr(int $code): string
829 829
     {
830 830
         if ($code < 0 || $code > 0x1FFFFF) {
831
-            throw new InvalidArgumentException((string)$code);
831
+            throw new InvalidArgumentException((string) $code);
832 832
         }
833 833
 
834 834
         if ($code <= 0x7F) {
Please login to merge, or discard this patch.
app/Http/RequestHandlers/DataFixUpdateAll.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -93,7 +93,7 @@
 block discarded – undo
93 93
         /** @var Collection<int,GedcomRecord> $records */
94 94
         $records = $rows->map(function (object $row) use ($tree): ?GedcomRecord {
95 95
             return $this->data_fix_service->getRecordByType($row->xref, $tree, $row->type);
96
-        })->filter(static function (?GedcomRecord $record) use ($module, $params): bool {
96
+        })->filter(static function (?GedcomRecord $record) use ($module, $params) : bool {
97 97
             return $record instanceof GedcomRecord && !$record->isPendingDeletion() && $module->doesRecordNeedUpdate($record, $params);
98 98
         });
99 99
 
Please login to merge, or discard this patch.