@@ -3,7 +3,8 @@ |
||
| 3 | 3 | use Fisharebest\Webtrees\Module\ModuleCustomInterface; |
| 4 | 4 | use Fisharebest\Webtrees\Module\ModuleCustomTrait; |
| 5 | 5 | |
| 6 | -return new class extends AbstractModule implements ModuleCustomInterface { |
|
| 6 | +return new class extends AbstractModule implements ModuleCustomInterface |
|
| 7 | +{ |
|
| 7 | 8 | use ModuleCustomTrait; |
| 8 | 9 | |
| 9 | 10 | /** |
@@ -252,7 +252,7 @@ |
||
| 252 | 252 | [$namespace, $view_name] = explode(self::NAMESPACE_SEPARATOR, $view_name, 2); |
| 253 | 253 | |
| 254 | 254 | if ((self::$namespaces[$namespace] ?? null) === null) { |
| 255 | - throw new RuntimeException('Namespace "' . e($namespace) . '" not found.'); |
|
| 255 | + throw new RuntimeException('Namespace "' . e($namespace) . '" not found.'); |
|
| 256 | 256 | } |
| 257 | 257 | |
| 258 | 258 | $view_file = self::$namespaces[$namespace] . $view_name . self::TEMPLATE_EXTENSION; |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | // Ambiguous dates - don't override calendar escape |
| 157 | 157 | if ($cal === '') { |
| 158 | 158 | if (preg_match('/^(JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC)$/', $m)) { |
| 159 | - $cal = GregorianDate::ESCAPE; |
|
| 159 | + $cal = GregorianDate::ESCAPE; |
|
| 160 | 160 | } elseif (preg_match('/^[345]\d\d\d$/', $y)) { |
| 161 | 161 | // Year 3000-5999 |
| 162 | 162 | $cal = JewishDate::ESCAPE; |
@@ -451,7 +451,7 @@ discard block |
||
| 451 | 451 | public function addYears(int $years, string $qualifier = ''): Date |
| 452 | 452 | { |
| 453 | 453 | $tmp = clone $this; |
| 454 | - $tmp->date1->year += $years; |
|
| 454 | + $tmp->date1->year += $years; |
|
| 455 | 455 | $tmp->date1->month = 0; |
| 456 | 456 | $tmp->date1->day = 0; |
| 457 | 457 | $tmp->date1->setJdFromYmd(); |
@@ -87,7 +87,7 @@ |
||
| 87 | 87 | public function getMenu(Tree $tree): ?Menu |
| 88 | 88 | { |
| 89 | 89 | $submenus = $this->module_service->findByComponent(ModuleListInterface::class, $tree, Auth::user()) |
| 90 | - ->map(static function (ModuleListInterface $module) use ($tree): ?Menu { |
|
| 90 | + ->map(static function (ModuleListInterface $module) use ($tree) : ?Menu { |
|
| 91 | 91 | return $module->listMenu($tree); |
| 92 | 92 | }) |
| 93 | 93 | ->filter() |
@@ -62,7 +62,7 @@ |
||
| 62 | 62 | } else { |
| 63 | 63 | $ip_address = '127.0.0.1'; |
| 64 | 64 | } |
| 65 | - $tree_id = $tree ? $tree->id() : null; |
|
| 65 | + $tree_id = $tree ? $tree->id() : null; |
|
| 66 | 66 | |
| 67 | 67 | DB::table('log')->insert([ |
| 68 | 68 | 'log_type' => $log_type, |
@@ -2618,7 +2618,7 @@ |
||
| 2618 | 2618 | /** @var ModuleBlockInterface|null $module */ |
| 2619 | 2619 | $module = $this->module_service |
| 2620 | 2620 | ->findByComponent(ModuleBlockInterface::class, $this->tree, Auth::user()) |
| 2621 | - ->first(static function (ModuleInterface $module) use ($block): bool { |
|
| 2621 | + ->first(static function (ModuleInterface $module) use ($block) : bool { |
|
| 2622 | 2622 | return $module->name() === $block && $module->name() !== 'html'; |
| 2623 | 2623 | }); |
| 2624 | 2624 | |
@@ -192,13 +192,13 @@ |
||
| 192 | 192 | if (strlen($match[1]) > strlen($match[2])) { |
| 193 | 193 | $match[2] = substr($match[1], 0, strlen($match[1]) - strlen($match[2])) . $match[2]; |
| 194 | 194 | } |
| 195 | - $ged_date = new Date("FROM {$cal} {$match[1]} TO {$cal} {$match[2]}"); |
|
| 195 | + $ged_date = new Date("from {$cal} {$match[1]} TO {$cal} {$match[2]}"); |
|
| 196 | 196 | $view = 'year'; |
| 197 | 197 | } elseif (preg_match('/^(\d+)(\?+)$/', $year, $match)) { |
| 198 | 198 | // advanced-year "decade/century wildcard" |
| 199 | 199 | $y1 = $match[1] . str_replace('?', '0', $match[2]); |
| 200 | 200 | $y2 = $match[1] . str_replace('?', '9', $match[2]); |
| 201 | - $ged_date = new Date("FROM {$cal} {$y1} TO {$cal} {$y2}"); |
|
| 201 | + $ged_date = new Date("from {$cal} {$y1} TO {$cal} {$y2}"); |
|
| 202 | 202 | $view = 'year'; |
| 203 | 203 | } else { |
| 204 | 204 | if ($year < 0) { |
@@ -291,7 +291,7 @@ discard block |
||
| 291 | 291 | $anniversary_facts = $this->calendar_service->getCalendarEvents($ged_year->minimumJulianDay(), $ged_year->maximumJulianDay(), $filterev, $tree); |
| 292 | 292 | } |
| 293 | 293 | |
| 294 | - $anniversary_facts = $this->applyFilter($anniversary_facts, $filterof, $filtersx); |
|
| 294 | + $anniversary_facts = $this->applyFilter($anniversary_facts, $filterof, $filtersx); |
|
| 295 | 295 | $anniversaries = Collection::make($anniversary_facts) |
| 296 | 296 | ->unique() |
| 297 | 297 | ->sort(static function (Fact $x, Fact $y): int { |
@@ -467,7 +467,7 @@ discard block |
||
| 467 | 467 | */ |
| 468 | 468 | private function applyFilter(array $facts, string $filterof, string $filtersx): array |
| 469 | 469 | { |
| 470 | - $filtered = []; |
|
| 470 | + $filtered = []; |
|
| 471 | 471 | $hundred_years_ago = Carbon::now()->subYears(100)->julianDay(); |
| 472 | 472 | foreach ($facts as $fact) { |
| 473 | 473 | $record = $fact->record(); |
@@ -519,7 +519,7 @@ discard block |
||
| 519 | 519 | $html = ''; |
| 520 | 520 | |
| 521 | 521 | foreach ($list as $xref => $facts) { |
| 522 | - $tmp = Factory::gedcomRecord()->make((string) $xref, $tree); |
|
| 522 | + $tmp = Factory::gedcomRecord()->make((string) $xref, $tree); |
|
| 523 | 523 | $html .= $tag1 . '<a href="' . e($tmp->url()) . '">' . $tmp->fullName() . '</a> '; |
| 524 | 524 | $html .= '<div class="indent">' . $facts . '</div>' . $tag2; |
| 525 | 525 | } |
@@ -13,7 +13,8 @@ |
||
| 13 | 13 | use Fisharebest\Webtrees\Module\ModuleCustomTrait; |
| 14 | 14 | use Fisharebest\Webtrees\View; |
| 15 | 15 | |
| 16 | -return new class extends MinimalTheme implements ModuleCustomInterface { |
|
| 16 | +return new class extends MinimalTheme implements ModuleCustomInterface |
|
| 17 | +{ |
|
| 17 | 18 | use ModuleCustomTrait; |
| 18 | 19 | |
| 19 | 20 | /** |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | 'generations' => 3, |
| 109 | 109 | 'layout' => PedigreeChartModule::STYLE_RIGHT, |
| 110 | 110 | ]); |
| 111 | - $content = view('modules/charts/chart', [ |
|
| 111 | + $content = view('modules/charts/chart', [ |
|
| 112 | 112 | 'block_id' => $block_id, |
| 113 | 113 | 'chart_url' => $chart_url, |
| 114 | 114 | 'class' => 'wt-chart-pedigree', |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | 'generations' => 2, |
| 125 | 125 | 'chart_style' => DescendancyChartModule::CHART_STYLE_TREE, |
| 126 | 126 | ]); |
| 127 | - $content = view('modules/charts/chart', [ |
|
| 127 | + $content = view('modules/charts/chart', [ |
|
| 128 | 128 | 'block_id' => $block_id, |
| 129 | 129 | 'chart_url' => $chart_url, |
| 130 | 130 | 'class' => 'wt-chart-descendants', |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | 'ajax' => true, |
| 140 | 140 | 'generations' => 2, |
| 141 | 141 | ]); |
| 142 | - $content = view('modules/charts/chart', [ |
|
| 142 | + $content = view('modules/charts/chart', [ |
|
| 143 | 143 | 'block_id' => $block_id, |
| 144 | 144 | 'chart_url' => $chart_url, |
| 145 | 145 | 'class' => 'wt-chart-hourglass', |
@@ -233,7 +233,7 @@ discard block |
||
| 233 | 233 | $default_xref = $gedcomid ?: $PEDIGREE_ROOT_ID; |
| 234 | 234 | |
| 235 | 235 | $type = $this->getBlockSetting($block_id, 'type', 'pedigree'); |
| 236 | - $xref = $this->getBlockSetting($block_id, 'pid', $default_xref); |
|
| 236 | + $xref = $this->getBlockSetting($block_id, 'pid', $default_xref); |
|
| 237 | 237 | |
| 238 | 238 | $charts = [ |
| 239 | 239 | 'pedigree' => I18N::translate('Pedigree'), |