1 | <?php |
||
12 | class DefaultFilesystem implements Filesystem |
||
13 | { |
||
14 | /** @var \Illuminate\Contracts\Filesystem\Factory */ |
||
15 | protected $filesystem; |
||
16 | |||
17 | /** @var array */ |
||
18 | protected $customRemoteHeaders = []; |
||
19 | |||
20 | public function __construct(Factory $filesystems) |
||
24 | |||
25 | /* |
||
26 | * Add a file to the mediaLibrary for the given media. |
||
27 | */ |
||
28 | public function add(string $file, Media $media, string $targetFileName = '') |
||
36 | |||
37 | /* |
||
38 | * Copy a file to the medialibrary for the given $media. |
||
39 | */ |
||
40 | public function copyToMediaLibrary(string $pathToFile, Media $media, bool $conversions = false, string $targetFileName = '') |
||
65 | |||
66 | /** |
||
67 | * Add custom remote headers on runtime. |
||
68 | * |
||
69 | * @param array $customRemoteHeaders |
||
70 | */ |
||
71 | public function addCustomRemoteHeaders(array $customRemoteHeaders) |
||
75 | |||
76 | /* |
||
77 | * Get the headers to be used when copying the |
||
78 | * given file to a remote filesytem. |
||
79 | */ |
||
80 | public function getRemoteHeadersForFile(string $file) : array |
||
88 | |||
89 | /* |
||
90 | * Copy a file from the medialibrary to the given targetFile. |
||
91 | */ |
||
92 | public function copyFromMediaLibrary(Media $media, string $targetFile): string |
||
104 | |||
105 | /* |
||
106 | * Remove all files for the given media. |
||
107 | */ |
||
108 | public function removeFiles(Media $media) |
||
119 | |||
120 | /* |
||
121 | * Rename a file for the given media. |
||
122 | */ |
||
123 | public function renameFile(Media $media, string $oldName) |
||
130 | |||
131 | /* |
||
132 | * Return the directory where all files of the given media are stored. |
||
133 | */ |
||
134 | public function getMediaDirectory(Media $media, bool $conversion = false) : string |
||
148 | |||
149 | /* |
||
150 | * Return the directory where all conversions of the given media are stored. |
||
151 | */ |
||
152 | public function getConversionDirectory(Media $media) : string |
||
156 | } |
||
157 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: