@@ -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++; |
@@ -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 | } |
@@ -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 => is_string($value) && in_array($value, $values, true) ? $value : null; |
|
123 | + $this->rules[] = static fn(?string $value) : ?string => is_string($value) && in_array($value, $values, true) ? $value : null; |
|
124 | 124 | |
125 | 125 | return $this; |
126 | 126 | } |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | */ |
132 | 132 | public function isLocalUrl(string $base_url): self |
133 | 133 | { |
134 | - $this->rules[] = static function (?string $value) use ($base_url): ?string { |
|
134 | + $this->rules[] = static function (?string $value) use ($base_url) : ?string { |
|
135 | 135 | if (is_string($value)) { |
136 | 136 | $value_info = parse_url($value); |
137 | 137 | $base_url_info = parse_url($base_url); |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | throw new HttpBadRequestException(I18N::translate('The parameter “%s” is missing.', $parameter)); |
230 | 230 | } |
231 | 231 | |
232 | - $callback = static fn (?array $value, Closure $rule): ?array => $rule($value); |
|
232 | + $callback = static fn(?array $value, Closure $rule) : ?array => $rule($value); |
|
233 | 233 | |
234 | 234 | $value = array_reduce($this->rules, $callback, $value); |
235 | 235 | $value ??= []; |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | $value = null; |
262 | 262 | } |
263 | 263 | |
264 | - $callback = static fn (?int $value, Closure $rule): ?int => $rule($value); |
|
264 | + $callback = static fn(?int $value, Closure $rule) : ?int => $rule($value); |
|
265 | 265 | |
266 | 266 | $value = array_reduce($this->rules, $callback, $value); |
267 | 267 | |
@@ -304,9 +304,9 @@ discard block |
||
304 | 304 | $value = null; |
305 | 305 | } |
306 | 306 | |
307 | - $callback = static fn (?string $value, Closure $rule): ?string => $rule($value); |
|
307 | + $callback = static fn(?string $value, Closure $rule) : ?string => $rule($value); |
|
308 | 308 | |
309 | - $value = array_reduce($this->rules, $callback, $value); |
|
309 | + $value = array_reduce($this->rules, $callback, $value); |
|
310 | 310 | $value ??= $default; |
311 | 311 | |
312 | 312 | if ($value === null || preg_match('//u', $value) !== 1) { |
@@ -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); |
@@ -67,7 +67,7 @@ |
||
67 | 67 | * |
68 | 68 | * @return int PSFS_PASS_ON / PSFS_FEED_ME / PSFS_ERR_FATAL |
69 | 69 | */ |
70 | - public function filter( $in, $out, &$consumed, $closing): int |
|
70 | + public function filter($in, $out, &$consumed, $closing): int |
|
71 | 71 | { |
72 | 72 | $return = PSFS_FEED_ME; |
73 | 73 |
@@ -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 |