@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | /** |
| 39 | 39 | * Create a header. |
| 40 | 40 | */ |
| 41 | - public function make(string $xref, Tree $tree, string|null $gedcom = null): Header|null |
|
| 41 | + public function make(string $xref, Tree $tree, string | null $gedcom = null): Header | null |
|
| 42 | 42 | { |
| 43 | 43 | return Registry::cache()->array()->remember(self::class . $xref . '@' . $tree->id(), function () use ($xref, $tree, $gedcom) { |
| 44 | 44 | $gedcom ??= $this->gedcom($xref, $tree); |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | * |
| 78 | 78 | * @return Header |
| 79 | 79 | */ |
| 80 | - public function new(string $xref, string $gedcom, string|null $pending, Tree $tree): Header |
|
| 80 | + public function new(string $xref, string $gedcom, string | null $pending, Tree $tree): Header |
|
| 81 | 81 | { |
| 82 | 82 | return new Header($xref, $gedcom, $pending, $tree); |
| 83 | 83 | } |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | * |
| 91 | 91 | * @return string|null |
| 92 | 92 | */ |
| 93 | - protected function gedcom(string $xref, Tree $tree): string|null |
|
| 93 | + protected function gedcom(string $xref, Tree $tree): string | null |
|
| 94 | 94 | { |
| 95 | 95 | return DB::table('other') |
| 96 | 96 | ->where('o_id', '=', $xref) |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | /** |
| 40 | 40 | * Create a repository. |
| 41 | 41 | */ |
| 42 | - public function make(string $xref, Tree $tree, string|null $gedcom = null): Repository|null |
|
| 42 | + public function make(string $xref, Tree $tree, string | null $gedcom = null): Repository | null |
|
| 43 | 43 | { |
| 44 | 44 | return Registry::cache()->array()->remember(self::class . $xref . '@' . $tree->id(), function () use ($xref, $tree, $gedcom) { |
| 45 | 45 | $gedcom ??= $this->gedcom($xref, $tree); |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | * |
| 84 | 84 | * @return Repository |
| 85 | 85 | */ |
| 86 | - public function new(string $xref, string $gedcom, string|null $pending, Tree $tree): Repository |
|
| 86 | + public function new(string $xref, string $gedcom, string | null $pending, Tree $tree): Repository |
|
| 87 | 87 | { |
| 88 | 88 | return new Repository($xref, $gedcom, $pending, $tree); |
| 89 | 89 | } |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | * |
| 97 | 97 | * @return string|null |
| 98 | 98 | */ |
| 99 | - protected function gedcom(string $xref, Tree $tree): string|null |
|
| 99 | + protected function gedcom(string $xref, Tree $tree): string | null |
|
| 100 | 100 | { |
| 101 | 101 | return DB::table('other') |
| 102 | 102 | ->where('o_id', '=', $xref) |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | /** |
| 39 | 39 | * Create a note. |
| 40 | 40 | */ |
| 41 | - public function make(string $xref, Tree $tree, string|null $gedcom = null): SharedNote|null |
|
| 41 | + public function make(string $xref, Tree $tree, string | null $gedcom = null): SharedNote | null |
|
| 42 | 42 | { |
| 43 | 43 | return Registry::cache()->array()->remember(self::class . $xref . '@' . $tree->id(), function () use ($xref, $tree, $gedcom) { |
| 44 | 44 | $gedcom ??= $this->gedcom($xref, $tree); |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | * |
| 78 | 78 | * @return SharedNote |
| 79 | 79 | */ |
| 80 | - public function new(string $xref, string $gedcom, string|null $pending, Tree $tree): SharedNote |
|
| 80 | + public function new(string $xref, string $gedcom, string | null $pending, Tree $tree): SharedNote |
|
| 81 | 81 | { |
| 82 | 82 | return new SharedNote($xref, $gedcom, $pending, $tree); |
| 83 | 83 | } |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | * |
| 91 | 91 | * @return string|null |
| 92 | 92 | */ |
| 93 | - protected function gedcom(string $xref, Tree $tree): string|null |
|
| 93 | + protected function gedcom(string $xref, Tree $tree): string | null |
|
| 94 | 94 | { |
| 95 | 95 | return DB::table('other') |
| 96 | 96 | ->where('o_id', '=', $xref) |
@@ -54,7 +54,7 @@ |
||
| 54 | 54 | * |
| 55 | 55 | * @throws InvalidGedcomEncodingException |
| 56 | 56 | */ |
| 57 | - public function detect(string $header): EncodingInterface|null |
|
| 57 | + public function detect(string $header): EncodingInterface | null |
|
| 58 | 58 | { |
| 59 | 59 | $utf_bom = [ |
| 60 | 60 | '/^' . UTF8::BYTE_ORDER_MARK . '/' => UTF8::NAME, |
@@ -43,9 +43,9 @@ discard block |
||
| 43 | 43 | * |
| 44 | 44 | * @return TimestampInterface |
| 45 | 45 | */ |
| 46 | - public function make(int $timestamp, UserInterface|null $user = null): TimestampInterface |
|
| 46 | + public function make(int $timestamp, UserInterface | null $user = null): TimestampInterface |
|
| 47 | 47 | { |
| 48 | - $user ??= Auth::user(); |
|
| 48 | + $user ??= Auth::user(); |
|
| 49 | 49 | $timezone = $user->getPreference(UserInterface::PREF_TIME_ZONE, Site::getPreference('TIMEZONE')); |
| 50 | 50 | $locale = I18N::locale()->code(); |
| 51 | 51 | |
@@ -59,9 +59,9 @@ discard block |
||
| 59 | 59 | * |
| 60 | 60 | * @return TimestampInterface |
| 61 | 61 | */ |
| 62 | - public function fromString(string|null $string, string $format = 'Y-m-d H:i:s', UserInterface|null $user = null): TimestampInterface |
|
| 62 | + public function fromString(string | null $string, string $format = 'Y-m-d H:i:s', UserInterface | null $user = null): TimestampInterface |
|
| 63 | 63 | { |
| 64 | - $string ??= date($format); |
|
| 64 | + $string ??= date($format); |
|
| 65 | 65 | $timestamp = date_create_from_format($format, $string); |
| 66 | 66 | |
| 67 | 67 | if ($timestamp === false) { |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | * |
| 77 | 77 | * @return TimestampInterface |
| 78 | 78 | */ |
| 79 | - public function now(UserInterface|null $user = null): TimestampInterface |
|
| 79 | + public function now(UserInterface | null $user = null): TimestampInterface |
|
| 80 | 80 | { |
| 81 | 81 | return $this->make(time(), $user); |
| 82 | 82 | } |
@@ -71,7 +71,7 @@ |
||
| 71 | 71 | } |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | - private function findElementByWildcard(string $tag): ElementInterface|null |
|
| 74 | + private function findElementByWildcard(string $tag): ElementInterface | null |
|
| 75 | 75 | { |
| 76 | 76 | foreach ($this->elements as $tags => $element) { |
| 77 | 77 | if (str_contains($tags, '*')) { |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | /** |
| 39 | 39 | * Create a submission. |
| 40 | 40 | */ |
| 41 | - public function make(string $xref, Tree $tree, string|null $gedcom = null): Submission|null |
|
| 41 | + public function make(string $xref, Tree $tree, string | null $gedcom = null): Submission | null |
|
| 42 | 42 | { |
| 43 | 43 | return Registry::cache()->array()->remember(self::class . $xref . '@' . $tree->id(), function () use ($xref, $tree, $gedcom) { |
| 44 | 44 | $gedcom ??= $this->gedcom($xref, $tree); |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | * |
| 78 | 78 | * @return Submission |
| 79 | 79 | */ |
| 80 | - public function new(string $xref, string $gedcom, string|null $pending, Tree $tree): Submission |
|
| 80 | + public function new(string $xref, string $gedcom, string | null $pending, Tree $tree): Submission |
|
| 81 | 81 | { |
| 82 | 82 | return new Submission($xref, $gedcom, $pending, $tree); |
| 83 | 83 | } |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | * |
| 91 | 91 | * @return string|null |
| 92 | 92 | */ |
| 93 | - protected function gedcom(string $xref, Tree $tree): string|null |
|
| 93 | + protected function gedcom(string $xref, Tree $tree): string | null |
|
| 94 | 94 | { |
| 95 | 95 | return DB::table('other') |
| 96 | 96 | ->where('o_id', '=', $xref) |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | /** |
| 39 | 39 | * Create a Location. |
| 40 | 40 | */ |
| 41 | - public function make(string $xref, Tree $tree, string|null $gedcom = null): Location|null |
|
| 41 | + public function make(string $xref, Tree $tree, string | null $gedcom = null): Location | null |
|
| 42 | 42 | { |
| 43 | 43 | return Registry::cache()->array()->remember(self::class . $xref . '@' . $tree->id(), function () use ($xref, $tree, $gedcom) { |
| 44 | 44 | $gedcom ??= $this->gedcom($xref, $tree); |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | * |
| 78 | 78 | * @return Location |
| 79 | 79 | */ |
| 80 | - public function new(string $xref, string $gedcom, string|null $pending, Tree $tree): Location |
|
| 80 | + public function new(string $xref, string $gedcom, string | null $pending, Tree $tree): Location |
|
| 81 | 81 | { |
| 82 | 82 | return new Location($xref, $gedcom, $pending, $tree); |
| 83 | 83 | } |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | * |
| 91 | 91 | * @return string|null |
| 92 | 92 | */ |
| 93 | - protected function gedcom(string $xref, Tree $tree): string|null |
|
| 93 | + protected function gedcom(string $xref, Tree $tree): string | null |
|
| 94 | 94 | { |
| 95 | 95 | return DB::table('other') |
| 96 | 96 | ->where('o_id', '=', $xref) |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | /** |
| 47 | 47 | * Create a GedcomRecord object. |
| 48 | 48 | */ |
| 49 | - public function make(string $xref, Tree $tree, string|null $gedcom = null): GedcomRecord|null |
|
| 49 | + public function make(string $xref, Tree $tree, string | null $gedcom = null): GedcomRecord | null |
|
| 50 | 50 | { |
| 51 | 51 | // We know the type of the record. Return it directly. |
| 52 | 52 | if ($gedcom !== null && preg_match('/^0(?: @[^@]+@)? ([A-Z_]+)/', $gedcom, $match)) { |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | * |
| 114 | 114 | * @return GedcomRecord |
| 115 | 115 | */ |
| 116 | - public function new(string $xref, string $gedcom, string|null $pending, Tree $tree): GedcomRecord |
|
| 116 | + public function new(string $xref, string $gedcom, string | null $pending, Tree $tree): GedcomRecord |
|
| 117 | 117 | { |
| 118 | 118 | return new GedcomRecord($xref, $gedcom, $pending, $tree); |
| 119 | 119 | } |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | * |
| 140 | 140 | * @return GedcomRecord |
| 141 | 141 | */ |
| 142 | - private function newGedcomRecord(string $type, string $xref, string $gedcom, string|null $pending, Tree $tree): GedcomRecord |
|
| 142 | + private function newGedcomRecord(string $type, string $xref, string $gedcom, string | null $pending, Tree $tree): GedcomRecord |
|
| 143 | 143 | { |
| 144 | 144 | switch ($type) { |
| 145 | 145 | case Family::RECORD_TYPE: |
@@ -199,7 +199,7 @@ discard block |
||
| 199 | 199 | * |
| 200 | 200 | * @return string|null |
| 201 | 201 | */ |
| 202 | - private function gedcom(string $xref, Tree $tree): string|null |
|
| 202 | + private function gedcom(string $xref, Tree $tree): string | null |
|
| 203 | 203 | { |
| 204 | 204 | return DB::table('other') |
| 205 | 205 | ->where('o_id', '=', $xref) |