@@ -265,10 +265,10 @@ discard block |
||
265 | 265 | public static function sanitizeKey(string $key): string |
266 | 266 | { |
267 | 267 | $key = str_replace(['https://', 'http://'], '', $key); // remove protocol (if URL) |
268 | - $key = Page::slugify($key); // slugify |
|
269 | - $key = trim($key, '/'); // remove leading/trailing slashes |
|
270 | - $key = str_replace(['\\', '/'], ['-', '-'], $key); // replace slashes by hyphens |
|
271 | - $key = substr($key, 0, 200); // truncate to 200 characters (NTFS filename length limit is 255 characters) |
|
268 | + $key = Page::slugify($key); // slugify |
|
269 | + $key = trim($key, '/'); // remove leading/trailing slashes |
|
270 | + $key = str_replace(['\\', '/'], ['-', '-'], $key); // replace slashes by hyphens |
|
271 | + $key = substr($key, 0, 200); // truncate to 200 characters (NTFS filename length limit is 255 characters) |
|
272 | 272 | |
273 | 273 | return $key; |
274 | 274 | } |
@@ -301,7 +301,7 @@ discard block |
||
301 | 301 | /** |
302 | 302 | * Convert the various expressions of a TTL value into duration in seconds. |
303 | 303 | */ |
304 | - protected function duration(\DateInterval|int|null $ttl): int |
|
304 | + protected function duration(\DateInterval | int | null $ttl): int |
|
305 | 305 | { |
306 | 306 | if ($ttl === null) { |
307 | 307 | return $this->duration; |
@@ -310,7 +310,7 @@ discard block |
||
310 | 310 | return $ttl; |
311 | 311 | } |
312 | 312 | if ($ttl instanceof \DateInterval) { |
313 | - return (int)$ttl->format('%s'); |
|
313 | + return (int) $ttl->format('%s'); |
|
314 | 314 | } |
315 | 315 | |
316 | 316 | throw new \InvalidArgumentException('TTL values must be one of null, int, \DateInterval'); |