@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | { |
101 | 101 | if ($record instanceof Individual) { |
102 | 102 | $facts = $record->facts(static::INDIVIDUAL_EVENTS, true) |
103 | - ->merge($record->spouseFamilies()->map(fn (Family $family): Collection => $family->facts(static::FAMILY_EVENTS, true))); |
|
103 | + ->merge($record->spouseFamilies()->map(fn(Family $family): Collection => $family->facts(static::FAMILY_EVENTS, true))); |
|
104 | 104 | } elseif ($record instanceof Family) { |
105 | 105 | $facts = $record->facts(static::FAMILY_EVENTS, true); |
106 | 106 | } else { |
@@ -110,11 +110,11 @@ discard block |
||
110 | 110 | // iCalendar only supports exact Gregorian dates. |
111 | 111 | $facts = $facts |
112 | 112 | ->flatten() |
113 | - ->filter(fn (Fact $fact): bool => $fact->date()->isOK()) |
|
114 | - ->filter(fn (Fact $fact): bool => $fact->date()->qual1 === '') |
|
115 | - ->filter(fn (Fact $fact): bool => $fact->date()->minimumDate() instanceof GregorianDate) |
|
116 | - ->filter(fn (Fact $fact): bool => $fact->date()->minimumJulianDay() === $fact->date()->maximumJulianDay()) |
|
117 | - ->mapWithKeys(fn (Fact $fact): array => [ |
|
113 | + ->filter(fn(Fact $fact): bool => $fact->date()->isOK()) |
|
114 | + ->filter(fn(Fact $fact): bool => $fact->date()->qual1 === '') |
|
115 | + ->filter(fn(Fact $fact): bool => $fact->date()->minimumDate() instanceof GregorianDate) |
|
116 | + ->filter(fn(Fact $fact): bool => $fact->date()->minimumJulianDay() === $fact->date()->maximumJulianDay()) |
|
117 | + ->mapWithKeys(fn(Fact $fact): array => [ |
|
118 | 118 | route(static::class, ['tree' => $record->tree()->name(), 'xref' => $fact->record()->xref(), 'fact_id' => $fact->id()]) => |
119 | 119 | $fact->label() . ' ā ' . $fact->date()->display(), |
120 | 120 | ]); |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | $record = Auth::checkRecordAccess($record); |
147 | 147 | |
148 | 148 | $fact = $record->facts() |
149 | - ->filter(fn (Fact $fact): bool => $fact->id() === $fact_id) |
|
149 | + ->filter(fn(Fact $fact): bool => $fact->id() === $fact_id) |
|
150 | 150 | ->first(); |
151 | 151 | |
152 | 152 | if ($fact instanceof Fact) { |
@@ -588,7 +588,7 @@ |
||
588 | 588 | |
589 | 589 | $module = $module_service |
590 | 590 | ->findByComponent(ModuleListInterface::class, $this->tree, Auth::user()) |
591 | - ->first(static fn (ModuleInterface $module): bool => $module instanceof IndividualListModule); |
|
591 | + ->first(static fn(ModuleInterface $module): bool => $module instanceof IndividualListModule); |
|
592 | 592 | |
593 | 593 | if ($type === 'list') { |
594 | 594 | return view('lists/surnames-bullet-list', [ |
@@ -397,7 +397,7 @@ discard block |
||
397 | 397 | |
398 | 398 | $pedigree_chart = $module_service |
399 | 399 | ->findByComponent(ModuleChartInterface::class, $tree, Auth::user()) |
400 | - ->first(static fn (ModuleInterface $module): bool => $module instanceof PedigreeChartModule); |
|
400 | + ->first(static fn(ModuleInterface $module): bool => $module instanceof PedigreeChartModule); |
|
401 | 401 | |
402 | 402 | if ($my_xref !== '' && $pedigree_chart instanceof PedigreeChartModule) { |
403 | 403 | $individual = Registry::individualFactory()->make($my_xref, $tree); |
@@ -486,7 +486,7 @@ discard block |
||
486 | 486 | |
487 | 487 | return $module_service |
488 | 488 | ->findByComponent(ModuleMenuInterface::class, $tree, Auth::user()) |
489 | - ->map(static fn (ModuleMenuInterface $menu): ?Menu => $menu->getMenu($tree)) |
|
489 | + ->map(static fn(ModuleMenuInterface $menu): ?Menu => $menu->getMenu($tree)) |
|
490 | 490 | ->filter() |
491 | 491 | ->all(); |
492 | 492 | } |
@@ -145,7 +145,7 @@ |
||
145 | 145 | // Find a module providing individual lists |
146 | 146 | $module = $this->module_service |
147 | 147 | ->findByComponent(ModuleListInterface::class, $tree, Auth::user()) |
148 | - ->first(static fn (ModuleInterface $module): bool => $module instanceof IndividualListModule); |
|
148 | + ->first(static fn(ModuleInterface $module): bool => $module instanceof IndividualListModule); |
|
149 | 149 | |
150 | 150 | $surnames = view('lists/surnames-compact-list', [ |
151 | 151 | 'module' => $module, |
@@ -328,7 +328,7 @@ |
||
328 | 328 | |
329 | 329 | $language = $this->module_service |
330 | 330 | ->findByInterface(ModuleLanguageInterface::class, true) |
331 | - ->first(fn (ModuleLanguageInterface $language): bool => $language->locale()->languageTag() === I18N::languageTag()); |
|
331 | + ->first(fn(ModuleLanguageInterface $language): bool => $language->locale()->languageTag() === I18N::languageTag()); |
|
332 | 332 | |
333 | 333 | echo '<h3>', I18N::translate('Relationship: %s', $this->relationship_service->nameFromPath($nodes->all(), $language)), '</h3>'; |
334 | 334 | $num_paths++; |
@@ -266,7 +266,7 @@ |
||
266 | 266 | $sidebar = ''; |
267 | 267 | |
268 | 268 | if ($places === []) { |
269 | - $places[] = $placeObj; |
|
269 | + $places[] = $placeObj; |
|
270 | 270 | } |
271 | 271 | |
272 | 272 | foreach ($places as $id => $place) { |
@@ -108,7 +108,7 @@ |
||
108 | 108 | if (is_string($content)) { |
109 | 109 | $headers['Content-Type'] ??= 'text/html; charset=UTF-8'; |
110 | 110 | } else { |
111 | - $content = json_encode($content, JSON_THROW_ON_ERROR | JSON_UNESCAPED_UNICODE); |
|
111 | + $content = json_encode($content, JSON_THROW_ON_ERROR | JSON_UNESCAPED_UNICODE); |
|
112 | 112 | $headers['Content-Type'] ??= 'application/json'; |
113 | 113 | } |
114 | 114 |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | */ |
103 | 103 | public function isBetween(int $minimum, int $maximum): self |
104 | 104 | { |
105 | - $this->rules[] = static function (?int $value) use ($minimum, $maximum): ?int { |
|
105 | + $this->rules[] = static function (?int $value) use ($minimum, $maximum) : ?int { |
|
106 | 106 | if (is_int($value) && $value >= $minimum && $value <= $maximum) { |
107 | 107 | return $value; |
108 | 108 | } |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | */ |
121 | 121 | public function isInArray(array $values): self |
122 | 122 | { |
123 | - $this->rules[] = static fn (?string $value): ?string => $value !== null && in_array($value, $values, true) ? $value : null; |
|
123 | + $this->rules[] = static fn(?string $value) : ?string => $value !== null && in_array($value, $values, true) ? $value : null; |
|
124 | 124 | |
125 | 125 | return $this; |
126 | 126 | } |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | */ |
131 | 131 | public function isNotEmpty(): self |
132 | 132 | { |
133 | - $this->rules[] = static fn (?string $value): ?string => $value !== null && $value !== '' ? $value : null; |
|
133 | + $this->rules[] = static fn(?string $value) : ?string => $value !== null && $value !== '' ? $value : null; |
|
134 | 134 | |
135 | 135 | return $this; |
136 | 136 | } |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | */ |
143 | 143 | public function isLocalUrl(string $base_url): self |
144 | 144 | { |
145 | - $this->rules[] = static function (?string $value) use ($base_url): ?string { |
|
145 | + $this->rules[] = static function (?string $value) use ($base_url) : ?string { |
|
146 | 146 | if ($value !== null) { |
147 | 147 | $value_info = parse_url($value); |
148 | 148 | $base_url_info = parse_url($base_url); |
@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | throw new HttpBadRequestException(I18N::translate('The parameter ā%sā is missing.', $parameter)); |
241 | 241 | } |
242 | 242 | |
243 | - $callback = static fn (?array $value, Closure $rule): ?array => $rule($value); |
|
243 | + $callback = static fn(?array $value, Closure $rule) : ?array => $rule($value); |
|
244 | 244 | |
245 | 245 | $value = array_reduce($this->rules, $callback, $value); |
246 | 246 | $value ??= []; |
@@ -272,7 +272,7 @@ discard block |
||
272 | 272 | $value = null; |
273 | 273 | } |
274 | 274 | |
275 | - $callback = static fn (?int $value, Closure $rule): ?int => $rule($value); |
|
275 | + $callback = static fn(?int $value, Closure $rule) : ?int => $rule($value); |
|
276 | 276 | |
277 | 277 | $value = array_reduce($this->rules, $callback, $value); |
278 | 278 | |
@@ -315,9 +315,9 @@ discard block |
||
315 | 315 | $value = null; |
316 | 316 | } |
317 | 317 | |
318 | - $callback = static fn (?string $value, Closure $rule): ?string => $rule($value); |
|
318 | + $callback = static fn(?string $value, Closure $rule) : ?string => $rule($value); |
|
319 | 319 | |
320 | - $value = array_reduce($this->rules, $callback, $value); |
|
320 | + $value = array_reduce($this->rules, $callback, $value); |
|
321 | 321 | $value ??= $default; |
322 | 322 | |
323 | 323 | if ($value === null || preg_match('//u', $value) !== 1) { |