@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | * |
| 58 | 58 | * @throws RuntimeException |
| 59 | 59 | */ |
| 60 | - public function __construct(Builder $builder, string|array $paths, array|null $options = null) |
|
| 60 | + public function __construct(Builder $builder, string | array $paths, array | null $options = null) |
|
| 61 | 61 | { |
| 62 | 62 | $this->builder = $builder; |
| 63 | 63 | $this->config = $builder->getConfig(); |
@@ -74,20 +74,20 @@ discard block |
||
| 74 | 74 | } |
| 75 | 75 | }); |
| 76 | 76 | $this->data = [ |
| 77 | - 'file' => '', // absolute file path |
|
| 78 | - 'files' => [], // bundle: array of files path |
|
| 79 | - 'filename' => '', // bundle: filename |
|
| 80 | - 'path' => '', // public path to the file |
|
| 81 | - 'url' => null, // URL if it's a remote file |
|
| 77 | + 'file' => '', // absolute file path |
|
| 78 | + 'files' => [], // bundle: array of files path |
|
| 79 | + 'filename' => '', // bundle: filename |
|
| 80 | + 'path' => '', // public path to the file |
|
| 81 | + 'url' => null, // URL if it's a remote file |
|
| 82 | 82 | 'missing' => false, // if file not found but missing allowed: 'missing' is true |
| 83 | - 'ext' => '', // file extension |
|
| 84 | - 'type' => '', // file type (e.g.: image, audio, video, etc.) |
|
| 85 | - 'subtype' => '', // file media type (e.g.: image/png, audio/mp3, etc.) |
|
| 86 | - 'size' => 0, // file size (in bytes) |
|
| 87 | - 'width' => 0, // image width (in pixels) |
|
| 88 | - 'height' => 0, // image height (in pixels) |
|
| 89 | - 'exif' => [], // exif data |
|
| 90 | - 'content' => '', // file content |
|
| 83 | + 'ext' => '', // file extension |
|
| 84 | + 'type' => '', // file type (e.g.: image, audio, video, etc.) |
|
| 85 | + 'subtype' => '', // file media type (e.g.: image/png, audio/mp3, etc.) |
|
| 86 | + 'size' => 0, // file size (in bytes) |
|
| 87 | + 'width' => 0, // image width (in pixels) |
|
| 88 | + 'height' => 0, // image height (in pixels) |
|
| 89 | + 'exif' => [], // exif data |
|
| 90 | + 'content' => '', // file content |
|
| 91 | 91 | ]; |
| 92 | 92 | |
| 93 | 93 | // handles options |
@@ -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'); |