@@ -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) |
@@ -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): Note|null |
|
| 41 | + public function make(string $xref, Tree $tree, string | null $gedcom = null): Note | 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 Note |
| 79 | 79 | */ |
| 80 | - public function new(string $xref, string $gedcom, string|null $pending, Tree $tree): Note |
|
| 80 | + public function new(string $xref, string $gedcom, string | null $pending, Tree $tree): Note |
|
| 81 | 81 | { |
| 82 | 82 | return new Note($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) |
@@ -34,7 +34,7 @@ |
||
| 34 | 34 | */ |
| 35 | 35 | class SlugFactory implements SlugFactoryInterface |
| 36 | 36 | { |
| 37 | - private Transliterator|null $transliterator = null; |
|
| 37 | + private Transliterator | null $transliterator = null; |
|
| 38 | 38 | |
| 39 | 39 | public function __construct() |
| 40 | 40 | { |
@@ -87,7 +87,7 @@ |
||
| 87 | 87 | * |
| 88 | 88 | * @return array<int,string> |
| 89 | 89 | */ |
| 90 | - public function newChildNames(Individual|null $father, Individual|null $mother, string $sex): array |
|
| 90 | + public function newChildNames(Individual | null $father, Individual | null $mother, string $sex): array |
|
| 91 | 91 | { |
| 92 | 92 | if (preg_match(self::REGEX_SURN, $this->extractName($father), $match) === 1) { |
| 93 | 93 | if ($sex === 'F') { |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | * |
| 87 | 87 | * @return array<int,string> |
| 88 | 88 | */ |
| 89 | - public function newChildNames(Individual|null $father, Individual|null $mother, string $sex): array |
|
| 89 | + public function newChildNames(Individual | null $father, Individual | null $mother, string $sex): array |
|
| 90 | 90 | { |
| 91 | 91 | return [ |
| 92 | 92 | $this->buildName('//', ['TYPE' => NameType::VALUE_BIRTH]), |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | * |
| 156 | 156 | * @return string |
| 157 | 157 | */ |
| 158 | - protected function extractName(Individual|null $individual): string |
|
| 158 | + protected function extractName(Individual | null $individual): string |
|
| 159 | 159 | { |
| 160 | 160 | if ($individual instanceof Individual) { |
| 161 | 161 | $fact = $individual |