@@ -724,7 +724,7 @@ discard block |
||
724 | 724 | * |
725 | 725 | * @return string |
726 | 726 | */ |
727 | - public function statsBirth(string|null $color_from = null, string|null $color_to = null): string |
|
727 | + public function statsBirth(string | null $color_from = null, string | null $color_to = null): string |
|
728 | 728 | { |
729 | 729 | return (new ChartBirth($this->century_service, $this->color_service, $this->tree)) |
730 | 730 | ->chartBirth($color_from, $color_to); |
@@ -782,7 +782,7 @@ discard block |
||
782 | 782 | * |
783 | 783 | * @return string |
784 | 784 | */ |
785 | - public function statsDeath(string|null $color_from = null, string|null $color_to = null): string |
|
785 | + public function statsDeath(string | null $color_from = null, string | null $color_to = null): string |
|
786 | 786 | { |
787 | 787 | return (new ChartDeath($this->century_service, $this->color_service, $this->tree)) |
788 | 788 | ->chartDeath($color_from, $color_to); |
@@ -1815,8 +1815,8 @@ discard block |
||
1815 | 1815 | * @return string |
1816 | 1816 | */ |
1817 | 1817 | public function chartCommonGiven( |
1818 | - string|null $color_from = null, |
|
1819 | - string|null $color_to = null, |
|
1818 | + string | null $color_from = null, |
|
1819 | + string | null $color_to = null, |
|
1820 | 1820 | int $maxtoshow = 7 |
1821 | 1821 | ): string { |
1822 | 1822 | $tot_indi = $this->totalIndividualsQuery(); |
@@ -1840,8 +1840,8 @@ discard block |
||
1840 | 1840 | * @return string |
1841 | 1841 | */ |
1842 | 1842 | public function chartCommonSurnames( |
1843 | - string|null $color_from = null, |
|
1844 | - string|null $color_to = null, |
|
1843 | + string | null $color_from = null, |
|
1844 | + string | null $color_to = null, |
|
1845 | 1845 | int $number_of_surnames = 10 |
1846 | 1846 | ): string { |
1847 | 1847 | $tot_indi = $this->totalIndividualsQuery(); |
@@ -1866,7 +1866,7 @@ discard block |
||
1866 | 1866 | * |
1867 | 1867 | * @return string |
1868 | 1868 | */ |
1869 | - public function chartMortality(string|null $color_living = null, string|null $color_dead = null): string |
|
1869 | + public function chartMortality(string | null $color_living = null, string | null $color_dead = null): string |
|
1870 | 1870 | { |
1871 | 1871 | $tot_l = $this->totalLivingQuery(); |
1872 | 1872 | $tot_d = $this->totalDeceasedQuery(); |
@@ -1884,8 +1884,8 @@ discard block |
||
1884 | 1884 | * @return string |
1885 | 1885 | */ |
1886 | 1886 | public function chartIndisWithSources( |
1887 | - string|null $color_from = null, |
|
1888 | - string|null $color_to = null |
|
1887 | + string | null $color_from = null, |
|
1888 | + string | null $color_to = null |
|
1889 | 1889 | ): string { |
1890 | 1890 | $tot_indi = $this->totalIndividualsQuery(); |
1891 | 1891 | $tot_indi_source = $this->totalIndisWithSourcesQuery(); |
@@ -1903,8 +1903,8 @@ discard block |
||
1903 | 1903 | * @return string |
1904 | 1904 | */ |
1905 | 1905 | public function chartFamsWithSources( |
1906 | - string|null $color_from = null, |
|
1907 | - string|null $color_to = null |
|
1906 | + string | null $color_from = null, |
|
1907 | + string | null $color_to = null |
|
1908 | 1908 | ): string { |
1909 | 1909 | $tot_fam = $this->totalFamiliesQuery(); |
1910 | 1910 | $tot_fam_source = $this->totalFamsWithSourcesQuery(); |
@@ -1921,9 +1921,9 @@ discard block |
||
1921 | 1921 | * @return string |
1922 | 1922 | */ |
1923 | 1923 | public function chartSex( |
1924 | - string|null $color_female = null, |
|
1925 | - string|null $color_male = null, |
|
1926 | - string|null $color_unknown = null |
|
1924 | + string | null $color_female = null, |
|
1925 | + string | null $color_male = null, |
|
1926 | + string | null $color_unknown = null |
|
1927 | 1927 | ): string { |
1928 | 1928 | $tot_m = $this->totalSexMalesQuery(); |
1929 | 1929 | $tot_f = $this->totalSexFemalesQuery(); |
@@ -304,7 +304,8 @@ discard block |
||
304 | 304 | <li class="wt-initials-list-item d-flex"> |
305 | 305 | <?php if ($count > 0) : ?> |
306 | 306 | <a href="<?= e($this->listUrl($tree, ['alpha' => $letter, 'show_marnm' => $show_marnm, 'tree' => $tree->name()])) ?>" class="wt-initial px-1<?= $letter === $alpha ? ' active' : '' ?> '" title="<?= I18N::number($count) ?>"><?= $this->displaySurnameInitial((string) $letter) ?></a> |
307 | - <?php else : ?> |
|
307 | + <?php else { |
|
308 | + : ?> |
|
308 | 309 | <span class="wt-initial px-1 text-muted"><?= $this->displaySurnameInitial((string) $letter) ?></span> |
309 | 310 | |
310 | 311 | <?php endif ?> |
@@ -359,6 +360,7 @@ discard block |
||
359 | 360 | switch ($alpha) { |
360 | 361 | case '@': |
361 | 362 | $filter = static fn (string $x): bool => $x === Individual::NOMEN_NESCIO; |
363 | +} |
|
362 | 364 | break; |
363 | 365 | case ',': |
364 | 366 | $filter = static fn (string $x): bool => $x === ''; |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | $surname_initials = $this->surnameInitials($surname_data); |
217 | 217 | |
218 | 218 | // We've requested a surname that doesn't currently exist. |
219 | - if ($surname !== '' && !array_key_exists($surname, $all_surns)) { |
|
219 | + if ($surname !== '' && !array_key_exists($surname, $all_surns)) { |
|
220 | 220 | $message = I18N::translate('There are no individuals with the surname “%s”', e($surname)); |
221 | 221 | FlashMessages::addMessage($message); |
222 | 222 | |
@@ -604,7 +604,7 @@ discard block |
||
604 | 604 | ->groupBy([DB::binaryColumn('n_givn')]); |
605 | 605 | |
606 | 606 | foreach ($query->get() as $row) { |
607 | - $initial = I18N::strtoupper(I18N::language()->initialLetter($row->n_givn)); |
|
607 | + $initial = I18N::strtoupper(I18N::language()->initialLetter($row->n_givn)); |
|
608 | 608 | $initials[$initial] ??= 0; |
609 | 609 | $initials[$initial] += (int) $row->count; |
610 | 610 | } |
@@ -385,7 +385,7 @@ |
||
385 | 385 | */ |
386 | 386 | private function filterActiveBlocks(Collection $blocks, Collection $active_blocks): Collection |
387 | 387 | { |
388 | - return $blocks->map(static fn (string $block_name): ModuleBlockInterface|null => $active_blocks->filter(static fn (ModuleInterface $block): bool => $block->name() === $block_name)->first()) |
|
388 | + return $blocks->map(static fn (string $block_name): ModuleBlockInterface | null => $active_blocks->filter(static fn (ModuleInterface $block): bool => $block->name() === $block_name)->first()) |
|
389 | 389 | ->filter(); |
390 | 390 | } |
391 | 391 | } |
@@ -696,7 +696,7 @@ discard block |
||
696 | 696 | |
697 | 697 | return strlen($module_name) <= 30; |
698 | 698 | }) |
699 | - ->map(static function (string $filename): ModuleCustomInterface|null { |
|
699 | + ->map(static function (string $filename): ModuleCustomInterface | null { |
|
700 | 700 | $module = self::load($filename); |
701 | 701 | |
702 | 702 | if ($module instanceof ModuleCustomInterface) { |
@@ -714,7 +714,7 @@ discard block |
||
714 | 714 | /** |
715 | 715 | * Load a custom module in a static scope, to prevent it from modifying local or object variables. |
716 | 716 | */ |
717 | - private static function load(string $filename): ModuleInterface|null |
|
717 | + private static function load(string $filename): ModuleInterface | null |
|
718 | 718 | { |
719 | 719 | try { |
720 | 720 | return include $filename; |
@@ -826,7 +826,7 @@ discard block |
||
826 | 826 | /** |
827 | 827 | * Find a specified module, if it is currently active. |
828 | 828 | */ |
829 | - public function findByName(string $module_name, bool $include_disabled = false): ModuleInterface|null |
|
829 | + public function findByName(string $module_name, bool $include_disabled = false): ModuleInterface | null |
|
830 | 830 | { |
831 | 831 | return $this->all($include_disabled) |
832 | 832 | ->first(static fn (ModuleInterface $module): bool => $module->name() === $module_name); |
@@ -45,10 +45,10 @@ discard block |
||
45 | 45 | /** |
46 | 46 | * Find the user with a specified user_id. |
47 | 47 | */ |
48 | - public function find(int|null $user_id): User|null |
|
48 | + public function find(int | null $user_id): User | null |
|
49 | 49 | { |
50 | 50 | return Registry::cache()->array() |
51 | - ->remember('user-' . $user_id, static fn (): User|null => DB::table('user') |
|
51 | + ->remember('user-' . $user_id, static fn (): User | null => DB::table('user') |
|
52 | 52 | ->where('user_id', '=', $user_id) |
53 | 53 | ->get() |
54 | 54 | ->map(User::rowMapper()) |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | /** |
59 | 59 | * Find the user with a specified email address. |
60 | 60 | */ |
61 | - public function findByEmail(string $email): User|null |
|
61 | + public function findByEmail(string $email): User | null |
|
62 | 62 | { |
63 | 63 | return DB::table('user') |
64 | 64 | ->where('email', '=', $email) |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | /** |
71 | 71 | * Find the user with a specified user_name or email address. |
72 | 72 | */ |
73 | - public function findByIdentifier(string $identifier): User|null |
|
73 | + public function findByIdentifier(string $identifier): User | null |
|
74 | 74 | { |
75 | 75 | return DB::table('user') |
76 | 76 | ->where('user_name', '=', $identifier) |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | /** |
103 | 103 | * Find the user with a specified password reset token. |
104 | 104 | */ |
105 | - public function findByToken(string $token): User|null |
|
105 | + public function findByToken(string $token): User | null |
|
106 | 106 | { |
107 | 107 | return DB::table('user') |
108 | 108 | ->join('user_setting AS us1', 'us1.user_id', '=', 'user.user_id') |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | /** |
121 | 121 | * Find the user with a specified user_name. |
122 | 122 | */ |
123 | - public function findByUserName(string $user_name): User|null |
|
123 | + public function findByUserName(string $user_name): User | null |
|
124 | 124 | { |
125 | 125 | return DB::table('user') |
126 | 126 | ->where('user_name', '=', $user_name) |
@@ -89,8 +89,8 @@ |
||
89 | 89 | |
90 | 90 | /** @var Collection<int,GedcomRecord> $records */ |
91 | 91 | $records = $rows |
92 | - ->map(fn (object $row): GedcomRecord|null => $this->data_fix_service->getRecordByType($row->xref, $tree, $row->type)) |
|
93 | - ->filter(static fn (GedcomRecord|null $record): bool => $record instanceof GedcomRecord && !$record->isPendingDeletion() && $module->doesRecordNeedUpdate($record, $params)); |
|
92 | + ->map(fn (object $row): GedcomRecord | null => $this->data_fix_service->getRecordByType($row->xref, $tree, $row->type)) |
|
93 | + ->filter(static fn (GedcomRecord | null $record): bool => $record instanceof GedcomRecord && !$record->isPendingDeletion() && $module->doesRecordNeedUpdate($record, $params)); |
|
94 | 94 | |
95 | 95 | foreach ($records as $record) { |
96 | 96 | $module->updateRecord($record, $params); |
@@ -81,10 +81,10 @@ |
||
81 | 81 | * |
82 | 82 | * @return Menu|null |
83 | 83 | */ |
84 | - public function getMenu(Tree $tree): Menu|null |
|
84 | + public function getMenu(Tree $tree): Menu | null |
|
85 | 85 | { |
86 | 86 | $submenus = $this->module_service->findByComponent(ModuleListInterface::class, $tree, Auth::user()) |
87 | - ->map(static fn (ModuleListInterface $module): Menu|null => $module->listMenu($tree)) |
|
87 | + ->map(static fn (ModuleListInterface $module): Menu | null => $module->listMenu($tree)) |
|
88 | 88 | ->filter() |
89 | 89 | ->sort(static fn (Menu $x, Menu $y): int => I18N::comparator()($x->getLabel(), $y->getLabel())); |
90 | 90 |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | // Find the requested individuals. |
161 | 161 | $individuals = (new Collection($xrefs)) |
162 | 162 | ->uniqueStrict() |
163 | - ->map(static fn (string $xref): Individual|null => Registry::individualFactory()->make($xref, $tree)) |
|
163 | + ->map(static fn (string $xref): Individual | null => Registry::individualFactory()->make($xref, $tree)) |
|
164 | 164 | ->filter() |
165 | 165 | ->filter(GedcomRecord::accessFilter()); |
166 | 166 | |
@@ -179,9 +179,9 @@ discard block |
||
179 | 179 | ]); |
180 | 180 | } |
181 | 181 | |
182 | - $individuals = array_map(static fn (string $xref): Individual|null => Registry::individualFactory()->make($xref, $tree), $xrefs); |
|
182 | + $individuals = array_map(static fn (string $xref): Individual | null => Registry::individualFactory()->make($xref, $tree), $xrefs); |
|
183 | 183 | |
184 | - $individuals = array_filter($individuals, static fn (Individual|null $individual): bool => $individual instanceof Individual && $individual->canShow()); |
|
184 | + $individuals = array_filter($individuals, static fn (Individual | null $individual): bool => $individual instanceof Individual && $individual->canShow()); |
|
185 | 185 | |
186 | 186 | if ($ajax) { |
187 | 187 | $this->layout = 'layouts/ajax'; |
@@ -237,9 +237,9 @@ discard block |
||
237 | 237 | protected function chart(Tree $tree, array $xrefs, int $scale): ResponseInterface |
238 | 238 | { |
239 | 239 | /** @var Individual[] $individuals */ |
240 | - $individuals = array_map(static fn (string $xref): Individual|null => Registry::individualFactory()->make($xref, $tree), $xrefs); |
|
240 | + $individuals = array_map(static fn (string $xref): Individual | null => Registry::individualFactory()->make($xref, $tree), $xrefs); |
|
241 | 241 | |
242 | - $individuals = array_filter($individuals, static fn (Individual|null $individual): bool => $individual instanceof Individual && $individual->canShow()); |
|
242 | + $individuals = array_filter($individuals, static fn (Individual | null $individual): bool => $individual instanceof Individual && $individual->canShow()); |
|
243 | 243 | |
244 | 244 | $baseyear = (int) date('Y'); |
245 | 245 | $topyear = 0; |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | /** |
148 | 148 | * A menu, to be added to the main application menu. |
149 | 149 | */ |
150 | - public function getMenu(Tree $tree): Menu|null |
|
150 | + public function getMenu(Tree $tree): Menu | null |
|
151 | 151 | { |
152 | 152 | $request = Registry::container()->get(ServerRequestInterface::class); |
153 | 153 | $route = Validator::attributes($request)->route(); |
@@ -409,7 +409,7 @@ discard block |
||
409 | 409 | $xrefs = array_map('strval', $xrefs); // PHP converts numeric keys to integers. |
410 | 410 | |
411 | 411 | // Fetch all the records in the cart. |
412 | - $records = array_map(static fn (string $xref): GedcomRecord|null => Registry::gedcomRecordFactory()->make($xref, $tree), $xrefs); |
|
412 | + $records = array_map(static fn (string $xref): GedcomRecord | null => Registry::gedcomRecordFactory()->make($xref, $tree), $xrefs); |
|
413 | 413 | |
414 | 414 | // Some records may have been deleted after they were added to the cart. |
415 | 415 | $records = array_filter($records); |