@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | { |
69 | 69 | $dummy = Registry::familyFactory()->new('', '0 @@ FAM', null, $tree); |
70 | 70 | $tags = new Collection(explode(',', $tree->getPreference('QUICK_REQUIRED_FAMFACTS'))); |
71 | - $facts = $tags->map(fn (string $tag): Fact => $this->createNewFact($dummy, $tag)); |
|
71 | + $facts = $tags->map(fn(string $tag): Fact => $this->createNewFact($dummy, $tag)); |
|
72 | 72 | |
73 | 73 | return Fact::sortFacts($facts); |
74 | 74 | } |
@@ -84,9 +84,9 @@ discard block |
||
84 | 84 | { |
85 | 85 | $dummy = Registry::individualFactory()->new('', '0 @@ INDI', null, $tree); |
86 | 86 | $tags = new Collection(explode(',', $tree->getPreference('QUICK_REQUIRED_FACTS'))); |
87 | - $facts = $tags->map(fn (string $tag): Fact => $this->createNewFact($dummy, $tag)); |
|
87 | + $facts = $tags->map(fn(string $tag): Fact => $this->createNewFact($dummy, $tag)); |
|
88 | 88 | $sex_fact = new Collection([new Fact('1 SEX ' . $sex, $dummy, '')]); |
89 | - $name_facts = Collection::make($names)->map(static fn (string $gedcom): Fact => new Fact($gedcom, $dummy, '')); |
|
89 | + $name_facts = Collection::make($names)->map(static fn(string $gedcom): Fact => new Fact($gedcom, $dummy, '')); |
|
90 | 90 | |
91 | 91 | return $sex_fact->concat($name_facts)->concat(Fact::sortFacts($facts)); |
92 | 92 | } |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | } |
153 | 153 | } |
154 | 154 | |
155 | - if ($values[$i] !== '' || $children_with_values && !$element instanceof AbstractXrefElement) { |
|
155 | + if ($values[$i] !== '' || $children_with_values && !$element instanceof AbstractXrefElement) { |
|
156 | 156 | if ($values[$i] === '') { |
157 | 157 | $gedcom_lines[] = $levels[$i] . ' ' . $tags[$i]; |
158 | 158 | } else { |
@@ -218,15 +218,15 @@ discard block |
||
218 | 218 | { |
219 | 219 | $subtags = Registry::elementFactory()->make($record->tag())->subtags(); |
220 | 220 | |
221 | - $subtags = array_filter($subtags, static fn (string $v, string $k) => !str_ends_with($v, ':1') || $record->facts([$k])->isEmpty(), ARRAY_FILTER_USE_BOTH); |
|
221 | + $subtags = array_filter($subtags, static fn(string $v, string $k) => !str_ends_with($v, ':1') || $record->facts([$k])->isEmpty(), ARRAY_FILTER_USE_BOTH); |
|
222 | 222 | |
223 | 223 | $subtags = array_keys($subtags); |
224 | 224 | |
225 | 225 | // Don't include facts/events that we have hidden in the control panel. |
226 | - $subtags = array_filter($subtags, fn (string $subtag): bool => !$this->isHiddenTag($record->tag() . ':' . $subtag)); |
|
226 | + $subtags = array_filter($subtags, fn(string $subtag): bool => !$this->isHiddenTag($record->tag() . ':' . $subtag)); |
|
227 | 227 | |
228 | 228 | if (!$include_hidden) { |
229 | - $fn_hidden = fn (string $t): bool => !$this->isHiddenTag($record->tag() . ':' . $t); |
|
229 | + $fn_hidden = fn(string $t): bool => !$this->isHiddenTag($record->tag() . ':' . $t); |
|
230 | 230 | $subtags = array_filter($subtags, $fn_hidden); |
231 | 231 | } |
232 | 232 | |
@@ -317,7 +317,7 @@ discard block |
||
317 | 317 | private function isHiddenTag(string $tag): bool |
318 | 318 | { |
319 | 319 | // Function to filter hidden tags. |
320 | - $fn_hide = static fn (string $x): bool => (bool) Site::getPreference('HIDE_' . $x); |
|
320 | + $fn_hide = static fn(string $x): bool => (bool) Site::getPreference('HIDE_' . $x); |
|
321 | 321 | |
322 | 322 | $preferences = array_filter(Gedcom::HIDDEN_TAGS, $fn_hide, ARRAY_FILTER_USE_KEY); |
323 | 323 | $preferences = array_values($preferences); |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | public function getSidebarContent(Individual $individual): string |
102 | 102 | { |
103 | 103 | $html = $individual->facts(static::HANDLED_FACTS) |
104 | - ->map(static fn (Fact $fact): string =>view('fact', ['fact' => $fact, 'record' => $individual])) |
|
104 | + ->map(static fn(Fact $fact): string =>view('fact', ['fact' => $fact, 'record' => $individual])) |
|
105 | 105 | ->implode(''); |
106 | 106 | |
107 | 107 | return strip_tags($html, '<a><div><span><i>'); |
@@ -114,6 +114,6 @@ discard block |
||
114 | 114 | */ |
115 | 115 | public function supportedFacts(): Collection |
116 | 116 | { |
117 | - return new Collection(array_map(static fn (string $tag): string => 'INDI:' . $tag, static::HANDLED_FACTS)); |
|
117 | + return new Collection(array_map(static fn(string $tag): string => 'INDI:' . $tag, static::HANDLED_FACTS)); |
|
118 | 118 | } |
119 | 119 | } |
@@ -142,7 +142,7 @@ |
||
142 | 142 | } |
143 | 143 | } |
144 | 144 | |
145 | - $callback = static fn (Fact $fact): bool => preg_match('/(?:^1|\n\d) NOTE/', $fact->gedcom()) === 1; |
|
145 | + $callback = static fn(Fact $fact): bool => preg_match('/(?:^1|\n\d) NOTE/', $fact->gedcom()) === 1; |
|
146 | 146 | |
147 | 147 | $this->facts = $facts->filter($callback); |
148 | 148 |
@@ -130,9 +130,9 @@ |
||
130 | 130 | |
131 | 131 | if ($one_line_only) { |
132 | 132 | return |
133 | - '<div class="fact_NOTE">' . |
|
134 | - I18N::translate('<span class="label">%1$s:</span> <span class="field" dir="auto">%2$s</span>', $label, $html) . |
|
135 | - '</div>'; |
|
133 | + '<div class="fact_NOTE">' . |
|
134 | + I18N::translate('<span class="label">%1$s:</span> <span class="field" dir="auto">%2$s</span>', $label, $html) . |
|
135 | + '</div>'; |
|
136 | 136 | } |
137 | 137 | |
138 | 138 | return |
@@ -828,7 +828,7 @@ |
||
828 | 828 | public static function chr(int $code): string |
829 | 829 | { |
830 | 830 | if ($code < 0 || $code > 0x1FFFFF) { |
831 | - throw new InvalidArgumentException((string)$code); |
|
831 | + throw new InvalidArgumentException((string) $code); |
|
832 | 832 | } |
833 | 833 | |
834 | 834 | if ($code <= 0x7F) { |
@@ -93,7 +93,7 @@ |
||
93 | 93 | /** @var Collection<int,GedcomRecord> $records */ |
94 | 94 | $records = $rows->map(function (object $row) use ($tree): ?GedcomRecord { |
95 | 95 | return $this->data_fix_service->getRecordByType($row->xref, $tree, $row->type); |
96 | - })->filter(static function (?GedcomRecord $record) use ($module, $params): bool { |
|
96 | + })->filter(static function (?GedcomRecord $record) use ($module, $params) : bool { |
|
97 | 97 | return $record instanceof GedcomRecord && !$record->isPendingDeletion() && $module->doesRecordNeedUpdate($record, $params); |
98 | 98 | }); |
99 | 99 |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | */ |
46 | 46 | public function make(int $timestamp, UserInterface $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 | |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | */ |
62 | 62 | public function fromString(?string $string, string $format = 'Y-m-d H:i:s', UserInterface $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) { |
@@ -126,7 +126,7 @@ |
||
126 | 126 | } else { |
127 | 127 | $match = []; |
128 | 128 | if (preg_match('/NOW([+\-]\d+)/', $attrs['default'], $match) > 0) { |
129 | - $date = Registry::timestampFactory()->now()->addDays((int)$match[1]); |
|
129 | + $date = Registry::timestampFactory()->now()->addDays((int) $match[1]); |
|
130 | 130 | $this->input['default'] = strtoupper($date->format('d M Y')); |
131 | 131 | } else { |
132 | 132 | $this->input['default'] = $attrs['default']; |
@@ -85,9 +85,9 @@ |
||
85 | 85 | $filesystem = new Filesystem(new LocalFilesystemAdapter(self::ROOT_DIR)); |
86 | 86 | |
87 | 87 | $scripts = $filesystem->listContents('app', FilesystemReader::LIST_DEEP) |
88 | - ->filter(static fn (StorageAttributes $file): bool => $file->isFile()) |
|
89 | - ->map(static fn (StorageAttributes $file): string => $file->path()) |
|
90 | - ->filter(static fn (string $script): bool => !str_contains($script, 'Interface.php') && !str_contains($script, 'Abstract')); |
|
88 | + ->filter(static fn(StorageAttributes $file): bool => $file->isFile()) |
|
89 | + ->map(static fn(StorageAttributes $file): string => $file->path()) |
|
90 | + ->filter(static fn(string $script): bool => !str_contains($script, 'Interface.php') && !str_contains($script, 'Abstract')); |
|
91 | 91 | |
92 | 92 | foreach ($scripts as $script) { |
93 | 93 | $class = strtr($script, ['app/' => '', '.php' => '', '/' => '\\']); |