| 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 | 2 | public function __construct(FilesystemAdapter $filesystemAdapter) |
|
| 21 | { |
||
| 22 | 2 | $adapter = $filesystemAdapter->getAdapter(); |
|
| 23 | 2 | if (!$adapter instanceof AliyunAdapter) { |
|
| 24 | throw new AliyunException("Adapter expect AliyunAdapter, But got ".$adapter::class, 0); |
||
| 25 | } |
||
| 26 | 2 | $this->adapter = $adapter; |
|
| 27 | } |
||
| 28 | |||
| 29 | /** |
||
| 30 | * @return \OSS\OssClient |
||
| 31 | */ |
||
| 32 | 2 | public function client() |
|
| 33 | { |
||
| 34 | 2 | return $this->adapter->getClient(); |
|
| 35 | } |
||
| 36 | |||
| 37 | /** |
||
| 38 | * @param string $bucket |
||
| 39 | * @return string |
||
| 40 | */ |
||
| 41 | 2 | public function bucket($bucket = "") |
|
| 44 | } |
||
| 45 | |||
| 46 | /** |
||
| 47 | * @param string $path |
||
| 48 | * @return string |
||
| 49 | */ |
||
| 50 | 2 | public function path($path = "") |
|
| 51 | { |
||
| 52 | 2 | return $this->adapter->getPrefixer()->prefixPath($path); |
|
| 53 | } |
||
| 54 | |||
| 55 | /** |
||
| 56 | * @param array $options |
||
| 57 | * @return array |
||
| 58 | */ |
||
| 59 | 2 | public function options($options = []) |
|
| 62 | } |
||
| 63 | } |
||
| 64 |