@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | protected string $gedcom; |
| 78 | 78 | |
| 79 | 79 | // GEDCOM data (after any pending edits) |
| 80 | - protected string|null $pending; |
|
| 80 | + protected string | null $pending; |
|
| 81 | 81 | |
| 82 | 82 | /** @var array<Fact> Facts extracted from $gedcom/$pending */ |
| 83 | 83 | protected array $facts; |
@@ -86,10 +86,10 @@ discard block |
||
| 86 | 86 | protected array $getAllNames = []; |
| 87 | 87 | |
| 88 | 88 | /** @var int|null Cached result */ |
| 89 | - private int|null $getPrimaryName = null; |
|
| 89 | + private int | null $getPrimaryName = null; |
|
| 90 | 90 | |
| 91 | 91 | /** @var int|null Cached result */ |
| 92 | - private int|null $getSecondaryName = null; |
|
| 92 | + private int | null $getSecondaryName = null; |
|
| 93 | 93 | |
| 94 | 94 | /** |
| 95 | 95 | * Create a GedcomRecord object from raw GEDCOM data. |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | * empty string for records with pending deletions |
| 101 | 101 | * @param Tree $tree |
| 102 | 102 | */ |
| 103 | - public function __construct(string $xref, string $gedcom, string|null $pending, Tree $tree) |
|
| 103 | + public function __construct(string $xref, string $gedcom, string | null $pending, Tree $tree) |
|
| 104 | 104 | { |
| 105 | 105 | $this->xref = $xref; |
| 106 | 106 | $this->gedcom = $gedcom; |
@@ -239,7 +239,7 @@ discard block |
||
| 239 | 239 | * |
| 240 | 240 | * @return bool |
| 241 | 241 | */ |
| 242 | - public function canShow(int|null $access_level = null): bool |
|
| 242 | + public function canShow(int | null $access_level = null): bool |
|
| 243 | 243 | { |
| 244 | 244 | $access_level ??= Auth::accessLevel($this->tree); |
| 245 | 245 | |
@@ -261,7 +261,7 @@ discard block |
||
| 261 | 261 | * |
| 262 | 262 | * @return bool |
| 263 | 263 | */ |
| 264 | - public function canShowName(int|null $access_level = null): bool |
|
| 264 | + public function canShowName(int | null $access_level = null): bool |
|
| 265 | 265 | { |
| 266 | 266 | return $this->canShow($access_level); |
| 267 | 267 | } |
@@ -311,7 +311,7 @@ discard block |
||
| 311 | 311 | } |
| 312 | 312 | |
| 313 | 313 | // Remove links to missing and private records |
| 314 | - $pattern = '/\n(\d) ' . Gedcom::REGEX_TAG . ' @(' . Gedcom::REGEX_XREF . ')@/'; |
|
| 314 | + $pattern = '/\n(\d) ' . Gedcom::REGEX_TAG . ' @(' . Gedcom::REGEX_XREF . ')@/'; |
|
| 315 | 315 | preg_match_all($pattern, $gedcom, $matches, PREG_SET_ORDER); |
| 316 | 316 | |
| 317 | 317 | foreach ($matches as $match) { |
@@ -431,7 +431,7 @@ discard block |
||
| 431 | 431 | * |
| 432 | 432 | * @return void |
| 433 | 433 | */ |
| 434 | - public function setPrimaryName(int|null $n = null): void |
|
| 434 | + public function setPrimaryName(int | null $n = null): void |
|
| 435 | 435 | { |
| 436 | 436 | $this->getPrimaryName = $n; |
| 437 | 437 | $this->getSecondaryName = null; |
@@ -482,7 +482,7 @@ discard block |
||
| 482 | 482 | * |
| 483 | 483 | * @return string|null |
| 484 | 484 | */ |
| 485 | - public function alternateName(): string|null |
|
| 485 | + public function alternateName(): string | null |
|
| 486 | 486 | { |
| 487 | 487 | if ($this->canShowName() && $this->getPrimaryName() !== $this->getSecondaryName()) { |
| 488 | 488 | $all_names = $this->getAllNames(); |
@@ -610,7 +610,7 @@ discard block |
||
| 610 | 610 | public function facts( |
| 611 | 611 | array $filter = [], |
| 612 | 612 | bool $sort = false, |
| 613 | - int|null $access_level = null, |
|
| 613 | + int | null $access_level = null, |
|
| 614 | 614 | bool $ignore_deleted = false |
| 615 | 615 | ): Collection { |
| 616 | 616 | $access_level ??= Auth::accessLevel($this->tree); |
@@ -743,7 +743,7 @@ discard block |
||
| 743 | 743 | return $chan_user; |
| 744 | 744 | } |
| 745 | 745 | |
| 746 | - public function createFact(string $gedcom, bool $update_chan, Fact|null $before = null): void |
|
| 746 | + public function createFact(string $gedcom, bool $update_chan, Fact | null $before = null): void |
|
| 747 | 747 | { |
| 748 | 748 | if (!preg_match('/^1 ' . Gedcom::REGEX_TAG . '/', $gedcom) || str_contains($gedcom, "\r")) { |
| 749 | 749 | throw new InvalidArgumentException('Invalid GEDCOM passed to GedcomRecord::createFact(' . $gedcom . ')'); |
@@ -816,7 +816,7 @@ discard block |
||
| 816 | 816 | foreach ($this->facts([], false, Auth::PRIV_HIDE, true) as $fact) { |
| 817 | 817 | if (!$updated && $fact->id() === $fact_id) { |
| 818 | 818 | $new_gedcom .= "\n" . $gedcom; |
| 819 | - $updated = true; |
|
| 819 | + $updated = true; |
|
| 820 | 820 | } else { |
| 821 | 821 | $new_gedcom .= "\n" . $fact->gedcom(); |
| 822 | 822 | } |