@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | $parts = array_filter($parts); |
125 | 125 | |
126 | 126 | $parts = array_map( |
127 | - static fn (string $tag, string $value): string => "\n2 " . $tag . ' ' . $value, |
|
127 | + static 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 |
||
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(); |
@@ -68,7 +68,7 @@ |
||
68 | 68 | $path = (string) parse_url($url, PHP_URL_PATH); |
69 | 69 | |
70 | 70 | // Paths containing UTF-8 characters need special handling. |
71 | - $path = implode('/', array_map(static fn (string $x): string => rawurlencode($x), explode('/', $path))); |
|
71 | + $path = implode('/', array_map(static fn(string $x): string => rawurlencode($x), explode('/', $path))); |
|
72 | 72 | |
73 | 73 | session_name($secure ? self::SECURE_SESSION_NAME : self::SESSION_NAME); |
74 | 74 | session_register_shutdown(); |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | */ |
82 | 82 | public static function fixed(string $nominative, string $genitive): Relationship |
83 | 83 | { |
84 | - return new self(fn () => [$nominative, $genitive]); |
|
84 | + return new self(fn() => [$nominative, $genitive]); |
|
85 | 85 | } |
86 | 86 | |
87 | 87 | /** |
@@ -126,9 +126,9 @@ discard block |
||
126 | 126 | */ |
127 | 127 | public function adopted(): Relationship |
128 | 128 | { |
129 | - $this->matchers[] = static fn (array $nodes): bool => count($nodes) > 2 && $nodes[2] |
|
129 | + $this->matchers[] = static fn(array $nodes): bool => count($nodes) > 2 && $nodes[2] |
|
130 | 130 | ->facts(['FAMC'], false, Auth::PRIV_HIDE) |
131 | - ->contains(fn (Fact $fact): bool => $fact->value() === '@' . $nodes[1]->xref() . '@' && $fact->attribute('PEDI') === 'adopted'); |
|
131 | + ->contains(fn(Fact $fact): bool => $fact->value() === '@' . $nodes[1]->xref() . '@' && $fact->attribute('PEDI') === 'adopted'); |
|
132 | 132 | |
133 | 133 | return $this; |
134 | 134 | } |
@@ -138,9 +138,9 @@ discard block |
||
138 | 138 | */ |
139 | 139 | public function adoptive(): Relationship |
140 | 140 | { |
141 | - $this->matchers[] = static fn (array $nodes): bool => $nodes[0] |
|
141 | + $this->matchers[] = static fn(array $nodes): bool => $nodes[0] |
|
142 | 142 | ->facts(['FAMC'], false, Auth::PRIV_HIDE) |
143 | - ->contains(fn (Fact $fact): bool => $fact->value() === '@' . $nodes[1]->xref() . '@' && $fact->attribute('PEDI') === 'adopted'); |
|
143 | + ->contains(fn(Fact $fact): bool => $fact->value() === '@' . $nodes[1]->xref() . '@' && $fact->attribute('PEDI') === 'adopted'); |
|
144 | 144 | |
145 | 145 | return $this; |
146 | 146 | } |
@@ -346,9 +346,9 @@ discard block |
||
346 | 346 | */ |
347 | 347 | public function fostered(): Relationship |
348 | 348 | { |
349 | - $this->matchers[] = static fn (array $nodes): bool => count($nodes) > 2 && $nodes[2] |
|
349 | + $this->matchers[] = static fn(array $nodes): bool => count($nodes) > 2 && $nodes[2] |
|
350 | 350 | ->facts(['FAMC'], false, Auth::PRIV_HIDE) |
351 | - ->contains(fn (Fact $fact): bool => $fact->value() === '@' . $nodes[1]->xref() . '@' && $fact->attribute('PEDI') === 'foster'); |
|
351 | + ->contains(fn(Fact $fact): bool => $fact->value() === '@' . $nodes[1]->xref() . '@' && $fact->attribute('PEDI') === 'foster'); |
|
352 | 352 | |
353 | 353 | return $this; |
354 | 354 | } |
@@ -358,9 +358,9 @@ discard block |
||
358 | 358 | */ |
359 | 359 | public function fostering(): Relationship |
360 | 360 | { |
361 | - $this->matchers[] = static fn (array $nodes): bool => $nodes[0] |
|
361 | + $this->matchers[] = static fn(array $nodes): bool => $nodes[0] |
|
362 | 362 | ->facts(['FAMC'], false, Auth::PRIV_HIDE) |
363 | - ->contains(fn (Fact $fact): bool => $fact->value() === '@' . $nodes[1]->xref() . '@' && $fact->attribute('PEDI') === 'foster'); |
|
363 | + ->contains(fn(Fact $fact): bool => $fact->value() === '@' . $nodes[1]->xref() . '@' && $fact->attribute('PEDI') === 'foster'); |
|
364 | 364 | |
365 | 365 | return $this; |
366 | 366 | } |
@@ -403,8 +403,8 @@ discard block |
||
403 | 403 | public function older(): Relationship |
404 | 404 | { |
405 | 405 | $this->matchers[] = static function (array $nodes): bool { |
406 | - $date1 = $nodes[0]->facts(['BIRT'], false, Auth::PRIV_HIDE)->map(fn (Fact $fact): Date => $fact->date())->first() ?? new Date(''); |
|
407 | - $date2 = $nodes[2]->facts(['BIRT'], false, Auth::PRIV_HIDE)->map(fn (Fact $fact): Date => $fact->date())->first() ?? new Date(''); |
|
406 | + $date1 = $nodes[0]->facts(['BIRT'], false, Auth::PRIV_HIDE)->map(fn(Fact $fact): Date => $fact->date())->first() ?? new Date(''); |
|
407 | + $date2 = $nodes[2]->facts(['BIRT'], false, Auth::PRIV_HIDE)->map(fn(Fact $fact): Date => $fact->date())->first() ?? new Date(''); |
|
408 | 408 | |
409 | 409 | return Date::compare($date1, $date2) > 0; |
410 | 410 | }; |
@@ -503,8 +503,8 @@ discard block |
||
503 | 503 | public function twin(): Relationship |
504 | 504 | { |
505 | 505 | $this->matchers[] = static function (array $nodes): bool { |
506 | - $date1 = $nodes[0]->facts(['BIRT'], false, Auth::PRIV_HIDE)->map(fn (Fact $fact): Date => $fact->date())->first() ?? new Date(''); |
|
507 | - $date2 = $nodes[2]->facts(['BIRT'], false, Auth::PRIV_HIDE)->map(fn (Fact $fact): Date => $fact->date())->first() ?? new Date(''); |
|
506 | + $date1 = $nodes[0]->facts(['BIRT'], false, Auth::PRIV_HIDE)->map(fn(Fact $fact): Date => $fact->date())->first() ?? new Date(''); |
|
507 | + $date2 = $nodes[2]->facts(['BIRT'], false, Auth::PRIV_HIDE)->map(fn(Fact $fact): Date => $fact->date())->first() ?? new Date(''); |
|
508 | 508 | |
509 | 509 | return |
510 | 510 | $date1->isOK() && |
@@ -531,8 +531,8 @@ discard block |
||
531 | 531 | public function younger(): Relationship |
532 | 532 | { |
533 | 533 | $this->matchers[] = static function (array $nodes): bool { |
534 | - $date1 = $nodes[0]->facts(['BIRT'], false, Auth::PRIV_HIDE)->map(fn (Fact $fact): Date => $fact->date())->first() ?? new Date(''); |
|
535 | - $date2 = $nodes[2]->facts(['BIRT'], false, Auth::PRIV_HIDE)->map(fn (Fact $fact): Date => $fact->date())->first() ?? new Date(''); |
|
534 | + $date1 = $nodes[0]->facts(['BIRT'], false, Auth::PRIV_HIDE)->map(fn(Fact $fact): Date => $fact->date())->first() ?? new Date(''); |
|
535 | + $date2 = $nodes[2]->facts(['BIRT'], false, Auth::PRIV_HIDE)->map(fn(Fact $fact): Date => $fact->date())->first() ?? new Date(''); |
|
536 | 536 | |
537 | 537 | return Date::compare($date1, $date2) < 0; |
538 | 538 | }; |
@@ -94,7 +94,7 @@ |
||
94 | 94 | |
95 | 95 | case 'name': |
96 | 96 | $name_tags = Registry::elementFactory()->make('INDI:NAME')->subtags(); |
97 | - $name_tags = array_map(static fn (string $tag): string => '2 ' . $tag, $name_tags); |
|
97 | + $name_tags = array_map(static fn(string $tag): string => '2 ' . $tag, $name_tags); |
|
98 | 98 | $name_tags[] = '1 NAME'; |
99 | 99 | |
100 | 100 | $records = $this->search_service->searchIndividuals([$tree], [$search]); |
@@ -148,7 +148,7 @@ |
||
148 | 148 | } |
149 | 149 | |
150 | 150 | // We may use markup to display values, but not when editing them. |
151 | - $values = array_map(static fn (string $x): string => strip_tags($x), $values); |
|
151 | + $values = array_map(static fn(string $x): string => strip_tags($x), $values); |
|
152 | 152 | |
153 | 153 | return view('components/select', [ |
154 | 154 | 'id' => $id, |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | ->groupBy(['surname']) |
120 | 120 | ->select([new Expression('n_surname /*! COLLATE utf8_bin */ AS surname'), new Expression('count(*) AS total')]) |
121 | 121 | ->pluck('total', 'surname') |
122 | - ->map(static fn (string $n): int => (int) $n) |
|
122 | + ->map(static fn(string $n): int => (int) $n) |
|
123 | 123 | ->all(); |
124 | 124 | |
125 | 125 | $all_surnames[$top_surname] = $variants; |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | break; |
148 | 148 | |
149 | 149 | case 'list': |
150 | - uasort($all_surnames, static fn (array $a, array $b): int => array_sum($b) <=> array_sum($a)); |
|
150 | + uasort($all_surnames, static fn(array $a, array $b): int => array_sum($b) <=> array_sum($a)); |
|
151 | 151 | $content = view('lists/surnames-bullet-list', [ |
152 | 152 | 'module' => $module, |
153 | 153 | 'surnames' => $all_surnames, |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | break; |
158 | 158 | |
159 | 159 | case 'array': |
160 | - uasort($all_surnames, static fn (array $a, array $b): int => array_sum($b) <=> array_sum($a)); |
|
160 | + uasort($all_surnames, static fn(array $a, array $b): int => array_sum($b) <=> array_sum($a)); |
|
161 | 161 | $content = view('lists/surnames-compact-list', [ |
162 | 162 | 'module' => $module, |
163 | 163 | 'surnames' => $all_surnames, |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | |
134 | 134 | $shares = $this->module_service |
135 | 135 | ->findByInterface(ModuleShareInterface::class) |
136 | - ->map(fn (ModuleShareInterface $module) => $module->share($individual)) |
|
136 | + ->map(fn(ModuleShareInterface $module) => $module->share($individual)) |
|
137 | 137 | ->filter(); |
138 | 138 | |
139 | 139 | return $this->viewResponse('individual-page', [ |
@@ -241,8 +241,8 @@ discard block |
||
241 | 241 | } |
242 | 242 | } |
243 | 243 | |
244 | - $meta_facts = array_map(static fn (string $x): string => strip_tags($x), $meta_facts); |
|
245 | - $meta_facts = array_map(static fn (string $x): string => trim($x), $meta_facts); |
|
244 | + $meta_facts = array_map(static fn(string $x): string => strip_tags($x), $meta_facts); |
|
245 | + $meta_facts = array_map(static fn(string $x): string => trim($x), $meta_facts); |
|
246 | 246 | |
247 | 247 | return implode(', ', $meta_facts); |
248 | 248 | } |
@@ -154,15 +154,15 @@ |
||
154 | 154 | |
155 | 155 | if ($family->children()->isNotEmpty()) { |
156 | 156 | $child_names = $family->children() |
157 | - ->map(static fn (Individual $individual): string => e($individual->getAllNames()[0]['givn'])) |
|
158 | - ->filter(static fn (string $x): bool => $x !== Individual::PRAENOMEN_NESCIO) |
|
157 | + ->map(static fn(Individual $individual): string => e($individual->getAllNames()[0]['givn'])) |
|
158 | + ->filter(static fn(string $x): bool => $x !== Individual::PRAENOMEN_NESCIO) |
|
159 | 159 | ->implode(', '); |
160 | 160 | |
161 | 161 | $meta_facts[] = I18N::translate('Children') . ' ' . $child_names; |
162 | 162 | } |
163 | 163 | |
164 | - $meta_facts = array_map(static fn (string $x): string => strip_tags($x), $meta_facts); |
|
165 | - $meta_facts = array_map(static fn (string $x): string => trim($x), $meta_facts); |
|
164 | + $meta_facts = array_map(static fn(string $x): string => strip_tags($x), $meta_facts); |
|
165 | + $meta_facts = array_map(static fn(string $x): string => trim($x), $meta_facts); |
|
166 | 166 | |
167 | 167 | return implode(', ', $meta_facts); |
168 | 168 | } |
@@ -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; |