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 pathMimeTypeRepresetsBackup($disk, $path) |
||
76 | |||
77 | |||
78 | /** |
||
79 | * @param \Illuminate\Contracts\Filesystem\Filesystem|null $disk |
||
80 | * @param string $path |
||
81 | * |
||
82 | * @return string|false |
||
83 | */ |
||
84 | protected static function pathMimeType($disk, $path) |
||
88 | |||
89 | /** |
||
90 | * @return \Spatie\Backup\BackupDestination\Backup|null |
||
91 | */ |
||
92 | public function newest() |
||
96 | |||
97 | /** |
||
98 | * @return \Spatie\Backup\BackupDestination\Backup|null |
||
99 | */ |
||
100 | public function oldest() |
||
106 | |||
107 | public function size(): int |
||
115 | } |
||
116 |
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):