@@ -1842,7 +1842,7 @@ |
||
1842 | 1842 | ->groupBy(['xref']); |
1843 | 1843 | }) |
1844 | 1844 | ->get() |
1845 | - ->map(fn (object $row): ?GedcomRecord => Registry::gedcomRecordFactory()->make($row->xref, $this->tree, $row->new_gedcom ?: $row->old_gedcom)) |
|
1845 | + ->map(fn(object $row): ?GedcomRecord => Registry::gedcomRecordFactory()->make($row->xref, $this->tree, $row->new_gedcom ?: $row->old_gedcom)) |
|
1846 | 1846 | ->filter() |
1847 | 1847 | ->all(); |
1848 | 1848 | break; |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | |
107 | 107 | return (new Collection($facts)) |
108 | 108 | ->reverse() |
109 | - ->map(static fn (string $clipping): Fact => new Fact($clipping, $record, md5($clipping))); |
|
109 | + ->map(static fn(string $clipping): Fact => new Fact($clipping, $record, md5($clipping))); |
|
110 | 110 | } |
111 | 111 | |
112 | 112 | /** |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | return (new Collection($clipboard)) |
127 | 127 | ->flatten(1) |
128 | 128 | ->reverse() |
129 | - ->map(static fn (string $clipping): Fact => new Fact($clipping, $record, md5($clipping))) |
|
130 | - ->filter(static fn (Fact $fact): bool => $types->contains(explode(':', $fact->tag())[1])); |
|
129 | + ->map(static fn(string $clipping): Fact => new Fact($clipping, $record, md5($clipping))) |
|
130 | + ->filter(static fn(Fact $fact): bool => $types->contains(explode(':', $fact->tag())[1])); |
|
131 | 131 | } |
132 | 132 | } |
@@ -162,7 +162,7 @@ |
||
162 | 162 | $function = strtolower($function); |
163 | 163 | |
164 | 164 | $disable_functions = explode(',', (string) ini_get('disable_functions')); |
165 | - $disable_functions = array_map(static fn (string $func): string => strtolower(trim($func)), $disable_functions); |
|
165 | + $disable_functions = array_map(static fn(string $func): string => strtolower(trim($func)), $disable_functions); |
|
166 | 166 | |
167 | 167 | return in_array($function, $disable_functions, true) || !function_exists($function); |
168 | 168 | } |
@@ -179,7 +179,7 @@ |
||
179 | 179 | throw new HttpNotFoundException(I18N::translate('%s does not exist.', 'news_id:' . $news_id)); |
180 | 180 | } |
181 | 181 | } else { |
182 | - $row = (object)['body' => '', 'subject' => '']; |
|
182 | + $row = (object) ['body' => '', 'subject' => '']; |
|
183 | 183 | } |
184 | 184 | |
185 | 185 | $title = I18N::translate('Add/edit a journal/news entry'); |
@@ -88,10 +88,10 @@ |
||
88 | 88 | } |
89 | 89 | |
90 | 90 | return preg_replace_callback_array([ |
91 | - '/\b(\d+)y\b/' => fn (array $match) => I18N::plural('%s year', '%s years', (int) $match[1], I18N::number((float) $match[1])), |
|
92 | - '/\b(\d+)m\b/' => fn (array $match) => I18N::plural('%s month', '%s months', (int) $match[1], I18N::number((float) $match[1])), |
|
93 | - '/\b(\d+)w\b/' => fn (array $match) => I18N::plural('%s week', '%s weeks', (int) $match[1], I18N::number((float) $match[1])), |
|
94 | - '/\b(\d+)d\b/' => fn (array $match) => I18N::plural('%s day', '%s days', (int) $match[1], I18N::number((float) $match[1])), |
|
91 | + '/\b(\d+)y\b/' => fn(array $match) => I18N::plural('%s year', '%s years', (int) $match[1], I18N::number((float) $match[1])), |
|
92 | + '/\b(\d+)m\b/' => fn(array $match) => I18N::plural('%s month', '%s months', (int) $match[1], I18N::number((float) $match[1])), |
|
93 | + '/\b(\d+)w\b/' => fn(array $match) => I18N::plural('%s week', '%s weeks', (int) $match[1], I18N::number((float) $match[1])), |
|
94 | + '/\b(\d+)d\b/' => fn(array $match) => I18N::plural('%s day', '%s days', (int) $match[1], I18N::number((float) $match[1])), |
|
95 | 95 | ], e($canonical)); |
96 | 96 | } |
97 | 97 | } |
@@ -79,7 +79,7 @@ |
||
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), |
@@ -68,7 +68,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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); |
@@ -101,7 +101,7 @@ discard block |
||
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 |
||
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 | } |
@@ -142,7 +142,7 @@ |
||
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 |