Total Complexity | 7 |
Total Lines | 52 |
Duplicated Lines | 0 % |
Coverage | 92.31% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
10 | class OssClientAdapter |
||
11 | { |
||
12 | /** |
||
13 | * @var AliyunAdapter |
||
14 | */ |
||
15 | protected $adapter; |
||
16 | |||
17 | /** |
||
18 | * @param FilesystemAdapter $filesystemAdapter |
||
19 | */ |
||
20 | 6 | public function __construct(FilesystemAdapter $filesystemAdapter) |
|
21 | { |
||
22 | 6 | $adapter = $filesystemAdapter->getAdapter(); |
|
23 | 6 | if (!$adapter instanceof AliyunAdapter) { |
|
24 | throw new AliyunException("Adapter expect AliyunAdapter, But got ".$adapter::class, 0); |
||
25 | } |
||
26 | 6 | $this->adapter = $adapter; |
|
27 | } |
||
28 | |||
29 | /** |
||
30 | * @return \OSS\OssClient |
||
31 | */ |
||
32 | 3 | public function client() |
|
33 | { |
||
34 | 3 | return $this->adapter->getClient(); |
|
35 | } |
||
36 | |||
37 | /** |
||
38 | * @param string $bucket |
||
39 | * @return string |
||
40 | */ |
||
41 | 3 | public function bucket($bucket = "") |
|
44 | } |
||
45 | |||
46 | /** |
||
47 | * @param string $path |
||
48 | * @return string |
||
49 | */ |
||
50 | 3 | public function path($path = "") |
|
51 | { |
||
52 | 3 | return $this->adapter->getPrefixer()->prefixPath($path); |
|
53 | } |
||
54 | |||
55 | /** |
||
56 | * @param array $options |
||
57 | * @return array |
||
58 | */ |
||
59 | 3 | public function options($options = []) |
|
62 | } |
||
63 | } |
||
64 |