@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | $path = (string) parse_url($url, PHP_URL_PATH); |
70 | 70 | |
71 | 71 | // Paths containing UTF-8 characters need special handling. |
72 | - $path = implode('/', array_map(static fn (string $x): string => rawurlencode($x), explode('/', $path))); |
|
72 | + $path = implode('/', array_map(static fn(string $x): string => rawurlencode($x), explode('/', $path))); |
|
73 | 73 | |
74 | 74 | session_name($secure ? self::SECURE_SESSION_NAME : self::SESSION_NAME); |
75 | 75 | session_register_shutdown(); |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | * |
110 | 110 | * @return array|bool|int|null|string |
111 | 111 | */ |
112 | - public static function get(string $name, array|bool|int|string $default = null) |
|
112 | + public static function get(string $name, array | bool | int | string $default = null) |
|
113 | 113 | { |
114 | 114 | return $_SESSION[$name] ?? $default; |
115 | 115 | } |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | * |
122 | 122 | * @return array|bool|int|null|string |
123 | 123 | */ |
124 | - public static function pull(string $name): array|bool|int|null|string |
|
124 | + public static function pull(string $name): array | bool | int | null | string |
|
125 | 125 | { |
126 | 126 | $value = self::get($name); |
127 | 127 | self::forget($name); |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | * |
166 | 166 | * @return void |
167 | 167 | */ |
168 | - public static function put(string $name, array|bool|int|null|string $value): void |
|
168 | + public static function put(string $name, array | bool | int | null | string $value): void |
|
169 | 169 | { |
170 | 170 | $_SESSION[$name] = $value; |
171 | 171 | } |
@@ -296,7 +296,7 @@ |
||
296 | 296 | * @param string $abstract |
297 | 297 | * @param string|object $concrete |
298 | 298 | */ |
299 | - public static function set(string $abstract, string|object $concrete): void |
|
299 | + public static function set(string $abstract, string | object $concrete): void |
|
300 | 300 | { |
301 | 301 | if (is_string($concrete)) { |
302 | 302 | Container::getInstance()->bind($abstract, $concrete); |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | * |
81 | 81 | * @param array<string>|int|AbstractCalendarDate $date |
82 | 82 | */ |
83 | - protected function __construct(array|int|AbstractCalendarDate $date) |
|
83 | + protected function __construct(array | int | AbstractCalendarDate $date) |
|
84 | 84 | { |
85 | 85 | // Construct from an integer (a julian day number) |
86 | 86 | if (is_int($date)) { |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | $this->month = static::MONTH_TO_NUMBER[$date[1]] ?? 0; |
98 | 98 | |
99 | 99 | if ($this->month === 0) { |
100 | - $this->day = 0; |
|
100 | + $this->day = 0; |
|
101 | 101 | } |
102 | 102 | |
103 | 103 | $this->year = $this->extractYear($date[0]); |
@@ -269,7 +269,7 @@ discard block |
||
269 | 269 | * |
270 | 270 | * @return string |
271 | 271 | */ |
272 | - public static function digits(string|int $n): string |
|
272 | + public static function digits(string | int $n): string |
|
273 | 273 | { |
274 | 274 | return self::$locale->digits((string) $n); |
275 | 275 | } |
@@ -324,7 +324,7 @@ discard block |
||
324 | 324 | |
325 | 325 | self::$language = $module_service |
326 | 326 | ->findByInterface(ModuleLanguageInterface::class) |
327 | - ->first(fn (ModuleLanguageInterface $module): bool => $module->locale()->languageTag() === $code); |
|
327 | + ->first(fn(ModuleLanguageInterface $module): bool => $module->locale()->languageTag() === $code); |
|
328 | 328 | } |
329 | 329 | |
330 | 330 | // Create a translator |
@@ -565,10 +565,10 @@ discard block |
||
565 | 565 | public static function comparator(): Closure |
566 | 566 | { |
567 | 567 | if (self::$collator instanceof Collator) { |
568 | - return static fn (string $x, string $y): int => (int) self::$collator->compare($x, $y); |
|
568 | + return static fn(string $x, string $y): int => (int) self::$collator->compare($x, $y); |
|
569 | 569 | } |
570 | 570 | |
571 | - return static fn (string $x, string $y): int => strcmp(self::strtolower($x), self::strtolower($y)); |
|
571 | + return static fn(string $x, string $y): int => strcmp(self::strtolower($x), self::strtolower($y)); |
|
572 | 572 | } |
573 | 573 | |
574 | 574 |
@@ -58,6 +58,6 @@ |
||
58 | 58 | $default_url = $request->getHeaderLine('Referer'); |
59 | 59 | $url = Validator::parsedBody($request)->isLocalUrl($base_url)->string('url', $default_url); |
60 | 60 | |
61 | - return Registry::responseFactory()->redirectUrl($url); |
|
61 | + return Registry::responseFactory()->redirectUrl($url); |
|
62 | 62 | } |
63 | 63 | } |
@@ -64,7 +64,7 @@ |
||
64 | 64 | $record = Auth::checkRecordAccess($record, true); |
65 | 65 | |
66 | 66 | // Find the fact to edit |
67 | - $fact = $record->facts()->first(fn (Fact $fact): bool => $fact->id() === $fact_id && $fact->canEdit()); |
|
67 | + $fact = $record->facts()->first(fn(Fact $fact): bool => $fact->id() === $fact_id && $fact->canEdit()); |
|
68 | 68 | |
69 | 69 | if ($fact === null) { |
70 | 70 | return Registry::responseFactory()->redirectUrl($record->url()); |
@@ -425,7 +425,7 @@ |
||
425 | 425 | unset($cart[$tree->name()][$xref]); |
426 | 426 | Session::put('cart', $cart); |
427 | 427 | |
428 | - return Registry::responseFactory()->redirect('module', [ |
|
428 | + return Registry::responseFactory()->redirect('module', [ |
|
429 | 429 | 'module' => $this->name(), |
430 | 430 | 'action' => 'Show', |
431 | 431 | 'tree' => $tree->name(), |
@@ -232,7 +232,7 @@ |
||
232 | 232 | 'style' => Validator::parsedBody($request)->string('style', ''), |
233 | 233 | 'width' => Validator::parsedBody($request)->string('width', ''), |
234 | 234 | 'xref' => Validator::parsedBody($request)->string('xref', ''), |
235 | - ]); |
|
235 | + ]); |
|
236 | 236 | } |
237 | 237 | |
238 | 238 | Auth::checkComponentAccess($this, ModuleChartInterface::class, $tree, $user); |
@@ -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 |