@@ -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']; |
@@ -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)); |
@@ -199,7 +199,7 @@ discard block |
||
| 199 | 199 | $currentLen = $endPos + 2; |
| 200 | 200 | $directive = substr($workingText, 0, $currentLen); |
| 201 | 201 | $workingText = substr($workingText, $currentLen); |
| 202 | - $result .= self::$waitingText . $directive; |
|
| 202 | + $result .= self::$waitingText . $directive; |
|
| 203 | 203 | self::$waitingText = ''; |
| 204 | 204 | break; |
| 205 | 205 | } |
@@ -310,7 +310,7 @@ discard block |
||
| 310 | 310 | if ($openParIndex !== false) { |
| 311 | 311 | // Opening parentheses always inherit the following directionality |
| 312 | 312 | self::$waitingText .= $currentLetter; |
| 313 | - $workingText = substr($workingText, $currentLen); |
|
| 313 | + $workingText = substr($workingText, $currentLen); |
|
| 314 | 314 | while (true) { |
| 315 | 315 | if ($workingText === '') { |
| 316 | 316 | break; |
@@ -318,13 +318,13 @@ discard block |
||
| 318 | 318 | if (str_starts_with($workingText, ' ')) { |
| 319 | 319 | // Spaces following this left parenthesis inherit the following directionality too |
| 320 | 320 | self::$waitingText .= ' '; |
| 321 | - $workingText = substr($workingText, 1); |
|
| 321 | + $workingText = substr($workingText, 1); |
|
| 322 | 322 | continue; |
| 323 | 323 | } |
| 324 | 324 | if (str_starts_with($workingText, ' ')) { |
| 325 | 325 | // Spaces following this left parenthesis inherit the following directionality too |
| 326 | 326 | self::$waitingText .= ' '; |
| 327 | - $workingText = substr($workingText, 6); |
|
| 327 | + $workingText = substr($workingText, 6); |
|
| 328 | 328 | continue; |
| 329 | 329 | } |
| 330 | 330 | break; |
@@ -341,9 +341,9 @@ discard block |
||
| 341 | 341 | // Exceptions to this rule will be handled later during final clean-up. |
| 342 | 342 | // |
| 343 | 343 | self::$waitingText .= $currentLetter; |
| 344 | - $workingText = substr($workingText, $currentLen); |
|
| 344 | + $workingText = substr($workingText, $currentLen); |
|
| 345 | 345 | if (self::$currentState !== '') { |
| 346 | - $result .= self::$waitingText; |
|
| 346 | + $result .= self::$waitingText; |
|
| 347 | 347 | self::$waitingText = ''; |
| 348 | 348 | } |
| 349 | 349 | break 2; // double break because we're waiting for more information |
@@ -472,7 +472,7 @@ discard block |
||
| 472 | 472 | } |
| 473 | 473 | if (substr($result . "\n", 0, self::LENGTH_START) !== self::START_LTR && substr($result . "\n", 0, self::LENGTH_START) !== self::START_RTL) { |
| 474 | 474 | $leadingText .= substr($result, 0, 1); |
| 475 | - $result = substr($result, 1); |
|
| 475 | + $result = substr($result, 1); |
|
| 476 | 476 | continue; |
| 477 | 477 | } |
| 478 | 478 | $result = substr($result, 0, self::LENGTH_START) . $leadingText . substr($result, self::LENGTH_START); |
@@ -614,11 +614,11 @@ discard block |
||
| 614 | 614 | private static function breakCurrentSpan(string &$result): void |
| 615 | 615 | { |
| 616 | 616 | // Interrupt the current span, insert that <br>, and then continue the current span |
| 617 | - $result .= self::$waitingText; |
|
| 617 | + $result .= self::$waitingText; |
|
| 618 | 618 | self::$waitingText = ''; |
| 619 | 619 | |
| 620 | 620 | $breakString = '<' . self::$currentState . 'br>'; |
| 621 | - $result .= $breakString; |
|
| 621 | + $result .= $breakString; |
|
| 622 | 622 | } |
| 623 | 623 | |
| 624 | 624 | /** |
@@ -675,7 +675,7 @@ discard block |
||
| 675 | 675 | break; |
| 676 | 676 | } // No more numeric strings |
| 677 | 677 | |
| 678 | - $tempResult .= substr($textSpan, 0, $posLRE + 3); // Copy everything preceding the numeric string |
|
| 678 | + $tempResult .= substr($textSpan, 0, $posLRE + 3); // Copy everything preceding the numeric string |
|
| 679 | 679 | $numericString = substr($textSpan, $posLRE + 3, $posPDF - $posLRE); // Separate the entire numeric string |
| 680 | 680 | $textSpan = substr($textSpan, $posPDF + 3); |
| 681 | 681 | $posColon = strpos($numericString, ':'); |
@@ -1142,7 +1142,7 @@ discard block |
||
| 1142 | 1142 | |
| 1143 | 1143 | // We're done: finish the span |
| 1144 | 1144 | $textSpan = self::starredName($textSpan, 'RTL'); // Wrap starred name in <u> and </u> tags |
| 1145 | - $result .= $textSpan . self::END_RTL; |
|
| 1145 | + $result .= $textSpan . self::END_RTL; |
|
| 1146 | 1146 | } |
| 1147 | 1147 | |
| 1148 | 1148 | if (self::$currentState !== 'LTR' && self::$currentState !== 'RTL') { |
@@ -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) { |