@@ -457,7 +457,7 @@ |
||
| 457 | 457 | public function addYears(int $years, string $qualifier = ''): Date |
| 458 | 458 | { |
| 459 | 459 | $tmp = clone $this; |
| 460 | - $tmp->date1->year += $years; |
|
| 460 | + $tmp->date1->year += $years; |
|
| 461 | 461 | $tmp->date1->month = 0; |
| 462 | 462 | $tmp->date1->day = 0; |
| 463 | 463 | $tmp->date1->setJdFromYmd(); |
@@ -431,7 +431,7 @@ |
||
| 431 | 431 | ]); |
| 432 | 432 | |
| 433 | 433 | $text_lines = array_map( |
| 434 | - fn (string $line): string => $this->fitTextToPixelWidth($line, $max_text_length), |
|
| 434 | + fn(string $line): string => $this->fitTextToPixelWidth($line, $max_text_length), |
|
| 435 | 435 | $text_lines |
| 436 | 436 | ); |
| 437 | 437 | |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | 'generations' => 3, |
| 118 | 118 | 'layout' => PedigreeChartModule::STYLE_RIGHT, |
| 119 | 119 | ]); |
| 120 | - $content = view('modules/charts/chart', [ |
|
| 120 | + $content = view('modules/charts/chart', [ |
|
| 121 | 121 | 'block_id' => $block_id, |
| 122 | 122 | 'chart_url' => $chart_url, |
| 123 | 123 | ]); |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | 'generations' => 2, |
| 138 | 138 | 'chart_style' => DescendancyChartModule::CHART_STYLE_TREE, |
| 139 | 139 | ]); |
| 140 | - $content = view('modules/charts/chart', [ |
|
| 140 | + $content = view('modules/charts/chart', [ |
|
| 141 | 141 | 'block_id' => $block_id, |
| 142 | 142 | 'chart_url' => $chart_url, |
| 143 | 143 | ]); |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | 'ajax' => true, |
| 158 | 158 | 'generations' => 2, |
| 159 | 159 | ]); |
| 160 | - $content = view('modules/charts/chart', [ |
|
| 160 | + $content = view('modules/charts/chart', [ |
|
| 161 | 161 | 'block_id' => $block_id, |
| 162 | 162 | 'chart_url' => $chart_url, |
| 163 | 163 | ]); |
@@ -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 | }; |
@@ -80,7 +80,7 @@ |
||
| 80 | 80 | // Default names facts. |
| 81 | 81 | $surname_tradition = SurnameTradition::create($tree->getPreference('SURNAME_TRADITION')); |
| 82 | 82 | $names = $surname_tradition->newParentNames($individual, $sex); |
| 83 | - $name_facts = array_map(static fn (string $gedcom): Fact => new Fact($gedcom, $dummy, ''), $names); |
|
| 83 | + $name_facts = array_map(static fn(string $gedcom): Fact => new Fact($gedcom, $dummy, ''), $names); |
|
| 84 | 84 | |
| 85 | 85 | $facts = [ |
| 86 | 86 | 'i' => [ |
@@ -86,7 +86,7 @@ |
||
| 86 | 86 | // Default names facts. |
| 87 | 87 | $surname_tradition = SurnameTradition::create($tree->getPreference('SURNAME_TRADITION')); |
| 88 | 88 | $names = $surname_tradition->newSpouseNames($individual, $sex); |
| 89 | - $name_facts = array_map(static fn (string $gedcom): Fact => new Fact($gedcom, $dummyi, ''), $names); |
|
| 89 | + $name_facts = array_map(static fn(string $gedcom): Fact => new Fact($gedcom, $dummyi, ''), $names); |
|
| 90 | 90 | |
| 91 | 91 | $facts = [ |
| 92 | 92 | 'i' => [ |
@@ -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]); |