| Conditions | 2 |
| Paths | 1 |
| Total Lines | 18 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 19 | public function macro(): Closure |
||
| 20 | { |
||
| 21 | return function (string $path, string $content, int $position = 0, array $options = []) { |
||
| 22 | try { |
||
| 23 | /** |
||
| 24 | * @var FilesystemAdapter $this |
||
| 25 | * @var AliyunAdapter $adapter |
||
| 26 | */ |
||
| 27 | $adapter = $this->getAdapter(); |
||
| 28 | return $adapter->getClient()->appendFile( |
||
| 29 | $adapter->getBucket(), |
||
| 30 | $adapter->getPrefixer()->prefixPath($path), |
||
| 31 | $content, |
||
| 32 | $position, |
||
| 33 | $adapter->getOptions()->mergeConfig(new Config($options)) |
||
| 34 | ); |
||
| 35 | } catch (OssException $exception) { |
||
| 36 | throw new AliyunException($exception->getErrorMessage(), 0, $exception); |
||
| 37 | } |
||
| 41 |