@@ -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']; |
@@ -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 |
@@ -146,8 +146,8 @@ discard block |
||
146 | 146 | { |
147 | 147 | $default_events = implode(',', self::DEFAULT_EVENTS); |
148 | 148 | |
149 | - $days = (int)$this->getBlockSetting($block_id, 'days', self::DEFAULT_DAYS); |
|
150 | - $filter = (bool)$this->getBlockSetting($block_id, 'filter', self::DEFAULT_FILTER); |
|
149 | + $days = (int) $this->getBlockSetting($block_id, 'days', self::DEFAULT_DAYS); |
|
150 | + $filter = (bool) $this->getBlockSetting($block_id, 'filter', self::DEFAULT_FILTER); |
|
151 | 151 | $infoStyle = $this->getBlockSetting($block_id, 'infoStyle', self::DEFAULT_STYLE); |
152 | 152 | $sortStyle = $this->getBlockSetting($block_id, 'sortStyle', self::DEFAULT_SORT); |
153 | 153 | $events = $this->getBlockSetting($block_id, 'events', $default_events); |
@@ -256,8 +256,8 @@ discard block |
||
256 | 256 | $sort_style = Validator::parsedBody($request)->isInArrayKeys($this->sortStyles())->string('sortStyle'); |
257 | 257 | $events = Validator::parsedBody($request)->array('events'); |
258 | 258 | |
259 | - $this->setBlockSetting($block_id, 'days', (string)$days); |
|
260 | - $this->setBlockSetting($block_id, 'filter', (string)$filter); |
|
259 | + $this->setBlockSetting($block_id, 'days', (string) $days); |
|
260 | + $this->setBlockSetting($block_id, 'filter', (string) $filter); |
|
261 | 261 | $this->setBlockSetting($block_id, 'infoStyle', $info_style); |
262 | 262 | $this->setBlockSetting($block_id, 'sortStyle', $sort_style); |
263 | 263 | $this->setBlockSetting($block_id, 'events', implode(',', $events)); |
@@ -228,7 +228,7 @@ |
||
228 | 228 | 'style' => Validator::parsedBody($request)->isInArrayKeys($this->styles())->integer('style'), |
229 | 229 | 'width' => Validator::parsedBody($request)->isBetween(self::MINIMUM_WIDTH, self::MAXIMUM_WIDTH)->integer('width'), |
230 | 230 | 'xref' => Validator::parsedBody($request)->isXref()->string('xref'), |
231 | - ])); |
|
231 | + ])); |
|
232 | 232 | } |
233 | 233 | |
234 | 234 | Auth::checkComponentAccess($this, ModuleChartInterface::class, $tree, $user); |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | */ |
108 | 108 | public function isBetween(int $minimum, int $maximum): self |
109 | 109 | { |
110 | - $this->rules[] = static function (?int $value) use ($minimum, $maximum): ?int { |
|
110 | + $this->rules[] = static function (?int $value) use ($minimum, $maximum) : ?int { |
|
111 | 111 | if (is_int($value) && $value >= $minimum && $value <= $maximum) { |
112 | 112 | return $value; |
113 | 113 | } |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | */ |
146 | 146 | public function isNotEmpty(): self |
147 | 147 | { |
148 | - $this->rules[] = static fn (?string $value): ?string => $value !== null && $value !== '' ? $value : null; |
|
148 | + $this->rules[] = static fn (?string $value) : ?string => $value !== null && $value !== '' ? $value : null; |
|
149 | 149 | |
150 | 150 | return $this; |
151 | 151 | } |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | { |
158 | 158 | $base_url = $this->request->getAttribute('base_url', ''); |
159 | 159 | |
160 | - $this->rules[] = static function (?string $value) use ($base_url): ?string { |
|
160 | + $this->rules[] = static function (?string $value) use ($base_url) : ?string { |
|
161 | 161 | if ($value !== null) { |
162 | 162 | $value_info = parse_url($value); |
163 | 163 | $base_url_info = parse_url($base_url); |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | throw new HttpBadRequestException(I18N::translate('The parameter “%s” is missing.', $parameter)); |
252 | 252 | } |
253 | 253 | |
254 | - $callback = static fn (?array $value, Closure $rule): ?array => $rule($value); |
|
254 | + $callback = static fn (?array $value, Closure $rule) : ?array => $rule($value); |
|
255 | 255 | |
256 | 256 | $value = array_reduce($this->rules, $callback, $value); |
257 | 257 | $value ??= []; |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | $value = null; |
284 | 284 | } |
285 | 285 | |
286 | - $callback = static fn (?int $value, Closure $rule): ?int => $rule($value); |
|
286 | + $callback = static fn (?int $value, Closure $rule) : ?int => $rule($value); |
|
287 | 287 | |
288 | 288 | $value = array_reduce($this->rules, $callback, $value); |
289 | 289 | |
@@ -326,9 +326,9 @@ discard block |
||
326 | 326 | $value = null; |
327 | 327 | } |
328 | 328 | |
329 | - $callback = static fn (?string $value, Closure $rule): ?string => $rule($value); |
|
329 | + $callback = static fn (?string $value, Closure $rule) : ?string => $rule($value); |
|
330 | 330 | |
331 | - $value = array_reduce($this->rules, $callback, $value); |
|
331 | + $value = array_reduce($this->rules, $callback, $value); |
|
332 | 332 | $value ??= $default; |
333 | 333 | |
334 | 334 | if ($value === null || preg_match('//u', $value) !== 1) { |
@@ -144,8 +144,7 @@ |
||
144 | 144 | } |
145 | 145 | return $genitive( |
146 | 146 | $sex === 'F' ? |
147 | - 'cousine du ' . $down . '<sup>e</sup> au ' . $up . '<sup>e</sup> degré' : |
|
148 | - 'cousin du ' . $down . '<sup>e</sup> au ' . $up . '<sup>e</sup> degré', |
|
147 | + 'cousine du ' . $down . '<sup>e</sup> au ' . $up . '<sup>e</sup> degré' : 'cousin du ' . $down . '<sup>e</sup> au ' . $up . '<sup>e</sup> degré', |
|
149 | 148 | $sex === 'F' ? 'de la ' : 'du ' |
150 | 149 | ); |
151 | 150 | }; |
@@ -154,7 +154,7 @@ |
||
154 | 154 | } |
155 | 155 | } |
156 | 156 | |
157 | - if ($values[$i] !== '' || $children_with_values && !$element instanceof AbstractXrefElement) { |
|
157 | + if ($values[$i] !== '' || $children_with_values && !$element instanceof AbstractXrefElement) { |
|
158 | 158 | if ($values[$i] === '') { |
159 | 159 | $gedcom_lines[] = $levels[$i] . ' ' . $tags[$i]; |
160 | 160 | } else { |