1 | <?php |
||
16 | class AliyunOssAdapter extends AbstractAdapter implements CanOverwriteFiles |
||
17 | { |
||
18 | use AliyunOssAdapterTrait; |
||
19 | use AliyunOssReadTrait; |
||
20 | |||
21 | /** |
||
22 | * @var bool |
||
23 | */ |
||
24 | protected $debug; |
||
25 | /** |
||
26 | * @var array |
||
27 | */ |
||
28 | |||
29 | /** |
||
30 | * @var OssClient |
||
31 | */ |
||
32 | protected $client; |
||
33 | /** |
||
34 | * @var string |
||
35 | */ |
||
36 | protected $bucket; |
||
37 | /** |
||
38 | * @var string |
||
39 | */ |
||
40 | protected $endPoint; |
||
41 | |||
42 | /** |
||
43 | * @var string |
||
44 | */ |
||
45 | protected $cdnDomain; |
||
46 | |||
47 | /** |
||
48 | * @var bool |
||
49 | */ |
||
50 | protected $ssl; |
||
51 | |||
52 | /** |
||
53 | * @var bool |
||
54 | */ |
||
55 | protected $isCname; |
||
56 | |||
57 | /** |
||
58 | * @var array |
||
59 | */ |
||
60 | protected $options = [ |
||
61 | |||
62 | ]; |
||
63 | |||
64 | /** |
||
65 | * AliyunOssAdapter constructor. |
||
66 | * @param OssClient $client |
||
67 | * @param AliyunOssConfig $config |
||
68 | * @param array $options |
||
69 | */ |
||
70 | 1 | public function __construct( |
|
84 | |||
85 | /** |
||
86 | * Used by \Illuminate\Filesystem\FilesystemAdapter::url |
||
87 | * |
||
88 | * @param string $path |
||
89 | * @return string |
||
90 | */ |
||
91 | public function getUrl($path) |
||
96 | |||
97 | /** |
||
98 | * Used by \Illuminate\Filesystem\FilesystemAdapter::temporaryUrl |
||
99 | * Get a temporary URL for the file at the given path. |
||
100 | * |
||
101 | * @param string $path |
||
102 | * @param \DateTimeInterface|int $expiration |
||
103 | * @param array $options |
||
104 | * @return string |
||
105 | * |
||
106 | * @throws \RuntimeException |
||
107 | */ |
||
108 | public function getTemporaryUrl($path, $expiration, array $options = []) |
||
115 | |||
116 | /** |
||
117 | * 列举文件夹内文件列表;可递归获取子文件夹; |
||
118 | * @param string $dirname 目录 |
||
119 | * @param bool $recursive 是否递归 |
||
120 | * @return mixed |
||
121 | * @throws OssException |
||
122 | */ |
||
123 | protected function listDirObjects($dirname = '', $recursive = false) |
||
193 | |||
194 | /** |
||
195 | * @param string $path |
||
196 | * @return array |
||
197 | */ |
||
198 | protected function readObject($path) |
||
206 | |||
207 | /** |
||
208 | * The the ACL visibility. |
||
209 | * |
||
210 | * @param string $path |
||
211 | * |
||
212 | * @return string |
||
213 | */ |
||
214 | protected function getObjectACL($path) |
||
220 | |||
221 | /** |
||
222 | * Normalize a result from OSS. |
||
223 | * |
||
224 | * @param array $object |
||
225 | * @param string $path |
||
226 | * |
||
227 | * @return array file metadata |
||
228 | */ |
||
229 | 4 | protected function normalizeResponse(array $object, $path = null) |
|
249 | |||
250 | /** |
||
251 | * Get options for a OSS call. done |
||
252 | * |
||
253 | * @param array $options |
||
254 | * |
||
255 | * @return array OSS options |
||
256 | */ |
||
257 | 4 | protected function getOptions(array $options = [], Config $config = null) |
|
267 | |||
268 | /** |
||
269 | * Retrieve options from a Config instance. done |
||
270 | * |
||
271 | * @param Config $config |
||
272 | * |
||
273 | * @return array |
||
274 | */ |
||
275 | 4 | protected function getOptionsFromConfig(Config $config) |
|
290 | |||
291 | /** |
||
292 | * @return OssClient |
||
293 | */ |
||
294 | public function getClient() |
||
298 | |||
299 | /** |
||
300 | * @return string |
||
301 | */ |
||
302 | public function getBucket() |
||
306 | |||
307 | /** |
||
308 | * @param string $func |
||
309 | * @param \Exception $e |
||
310 | */ |
||
311 | protected function logErr($func, $e) |
||
318 | } |
||
319 |
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: