@@ -246,10 +246,10 @@ discard block |
||
| 246 | 246 | public function sanitizeKey(string $key): string |
| 247 | 247 | { |
| 248 | 248 | $key = str_replace(['https://', 'http://'], '', $key); // remove protocol (if URL) |
| 249 | - $key = Page::slugify($key); // slugify |
|
| 250 | - $key = trim($key, '/'); // remove leading/trailing slashes |
|
| 251 | - $key = str_replace(['\\', '/'], ['-', '-'], $key); // replace slashes by hyphens |
|
| 252 | - $key = substr($key, 0, 200); // truncate to 200 characters (NTFS filename length limit is 255 characters) |
|
| 249 | + $key = Page::slugify($key); // slugify |
|
| 250 | + $key = trim($key, '/'); // remove leading/trailing slashes |
|
| 251 | + $key = str_replace(['\\', '/'], ['-', '-'], $key); // replace slashes by hyphens |
|
| 252 | + $key = substr($key, 0, 200); // truncate to 200 characters (NTFS filename length limit is 255 characters) |
|
| 253 | 253 | |
| 254 | 254 | return $key; |
| 255 | 255 | } |
@@ -298,7 +298,7 @@ discard block |
||
| 298 | 298 | /** |
| 299 | 299 | * Convert the various expressions of a TTL value into duration in seconds. |
| 300 | 300 | */ |
| 301 | - protected function duration(\DateInterval|int|null $ttl): int |
|
| 301 | + protected function duration(\DateInterval | int | null $ttl): int |
|
| 302 | 302 | { |
| 303 | 303 | if ($ttl === null) { |
| 304 | 304 | return $this->duration; |
@@ -307,7 +307,7 @@ discard block |
||
| 307 | 307 | return $ttl; |
| 308 | 308 | } |
| 309 | 309 | if ($ttl instanceof \DateInterval) { |
| 310 | - return (int)$ttl->format('%s'); |
|
| 310 | + return (int) $ttl->format('%s'); |
|
| 311 | 311 | } |
| 312 | 312 | |
| 313 | 313 | throw new \InvalidArgumentException('TTL values must be one of null, int, \DateInterval'); |