1 | <?php |
||
8 | class BackupCollection extends Collection |
||
9 | { |
||
10 | /** @var null|int */ |
||
11 | protected $sizeCache = null; |
||
12 | |||
13 | /** @var array */ |
||
14 | protected static $allowedMimeTypes = [ |
||
15 | 'application/zip', 'application/x-zip', 'application/x-gzip', |
||
16 | ]; |
||
17 | |||
18 | /** |
||
19 | * @param \Illuminate\Contracts\Filesystem\Filesystem|null $disk |
||
20 | * @param array $files |
||
21 | * |
||
22 | * @return \Spatie\Backup\BackupDestination\BackupCollection |
||
23 | */ |
||
24 | public static function createFromFiles($disk, array $files): self |
||
38 | |||
39 | /** |
||
40 | * @param \Illuminate\Contracts\Filesystem\Filesystem|null $disk |
||
41 | * @param string $path |
||
42 | * |
||
43 | * @return bool |
||
44 | */ |
||
45 | protected static function pathRepresentsBackup($disk, $path) |
||
50 | |||
51 | /** |
||
52 | * @param string $path |
||
53 | * |
||
54 | * @return bool |
||
55 | */ |
||
56 | protected static function pathExtensionRepresentsBackup($path) |
||
60 | |||
61 | /** |
||
62 | * @param \Illuminate\Contracts\Filesystem\Filesystem|null $disk |
||
63 | * @param string $path |
||
64 | * |
||
65 | * @return bool |
||
66 | */ |
||
67 | protected static function pathMimeRepresetsBackup($disk, $path) |
||
76 | |||
77 | /** |
||
78 | * @return \Spatie\Backup\BackupDestination\Backup|null |
||
79 | */ |
||
80 | public function newest() |
||
84 | |||
85 | /** |
||
86 | * @return \Spatie\Backup\BackupDestination\Backup|null |
||
87 | */ |
||
88 | public function oldest() |
||
94 | |||
95 | public function size(): int |
||
103 | } |
||
104 |
It seems like you allow that null is being passed for a parameter, however the function which is called does not seem to accept null.
We recommend to add an additional type check (or disallow null for the parameter):