@@ -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 |
@@ -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' => '', '/' => '\\']); |
@@ -154,7 +154,7 @@ |
||
154 | 154 | { |
155 | 155 | $tree = Validator::attributes($request)->treeOptional(); |
156 | 156 | $default = Site::getPreference('DEFAULT_GEDCOM'); |
157 | - $tree ??= $this->tree_service->all()[$default] ?? $this->tree_service->all()->first(); |
|
157 | + $tree ??= $this->tree_service->all()[$default] ?? $this->tree_service->all()->first(); |
|
158 | 158 | |
159 | 159 | $status_code = $exception->getCode(); |
160 | 160 |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | */ |
93 | 93 | public function isBetween(int $minimum, int $maximum): self |
94 | 94 | { |
95 | - $this->rules[] = static function (?int $value) use ($minimum, $maximum): ?int { |
|
95 | + $this->rules[] = static function (?int $value) use ($minimum, $maximum) : ?int { |
|
96 | 96 | if (is_int($value) && $value >= $minimum && $value <= $maximum) { |
97 | 97 | return $value; |
98 | 98 | } |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | */ |
111 | 111 | public function isInArray(array $values): self |
112 | 112 | { |
113 | - $this->rules[] = static fn (?string $value): ?string => is_string($value) && in_array($value, $values, true) ? $value : null; |
|
113 | + $this->rules[] = static fn(?string $value) : ?string => is_string($value) && in_array($value, $values, true) ? $value : null; |
|
114 | 114 | |
115 | 115 | return $this; |
116 | 116 | } |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | */ |
122 | 122 | public function isLocalUrl(string $base_url): self |
123 | 123 | { |
124 | - $this->rules[] = static function (?string $value) use ($base_url): ?string { |
|
124 | + $this->rules[] = static function (?string $value) use ($base_url) : ?string { |
|
125 | 125 | if (is_string($value)) { |
126 | 126 | $value_info = parse_url($value); |
127 | 127 | $base_url_info = parse_url($base_url); |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | $value = null; |
195 | 195 | } |
196 | 196 | |
197 | - $callback = static fn (?array $value, Closure $rule): ?array => $rule($value); |
|
197 | + $callback = static fn(?array $value, Closure $rule) : ?array => $rule($value); |
|
198 | 198 | |
199 | 199 | return array_reduce($this->rules, $callback, $value); |
200 | 200 | } |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | $value = null; |
215 | 215 | } |
216 | 216 | |
217 | - $callback = static fn (?int $value, Closure $rule): ?int => $rule($value); |
|
217 | + $callback = static fn(?int $value, Closure $rule) : ?int => $rule($value); |
|
218 | 218 | |
219 | 219 | return array_reduce($this->rules, $callback, $value); |
220 | 220 | } |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | $value = null; |
233 | 233 | } |
234 | 234 | |
235 | - $callback = static fn (?string $value, Closure $rule): ?string => $rule($value); |
|
235 | + $callback = static fn(?string $value, Closure $rule) : ?string => $rule($value); |
|
236 | 236 | |
237 | 237 | return array_reduce($this->rules, $callback, $value); |
238 | 238 | } |
@@ -276,7 +276,7 @@ discard block |
||
276 | 276 | $value = null; |
277 | 277 | } |
278 | 278 | |
279 | - $callback = static fn (?array $value, Closure $rule): ?array => $rule($value); |
|
279 | + $callback = static fn(?array $value, Closure $rule) : ?array => $rule($value); |
|
280 | 280 | |
281 | 281 | $value = array_reduce($this->rules, $callback, $value); |
282 | 282 | |
@@ -305,7 +305,7 @@ discard block |
||
305 | 305 | $value = null; |
306 | 306 | } |
307 | 307 | |
308 | - $callback = static fn (?int $value, Closure $rule): ?int => $rule($value); |
|
308 | + $callback = static fn(?int $value, Closure $rule) : ?int => $rule($value); |
|
309 | 309 | |
310 | 310 | $value = array_reduce($this->rules, $callback, $value); |
311 | 311 | |
@@ -348,9 +348,9 @@ discard block |
||
348 | 348 | $value = null; |
349 | 349 | } |
350 | 350 | |
351 | - $callback = static fn (?string $value, Closure $rule): ?string => $rule($value); |
|
351 | + $callback = static fn(?string $value, Closure $rule) : ?string => $rule($value); |
|
352 | 352 | |
353 | - $value = array_reduce($this->rules, $callback, $value); |
|
353 | + $value = array_reduce($this->rules, $callback, $value); |
|
354 | 354 | $value ??= $default; |
355 | 355 | |
356 | 356 | if ($value === null) { |