Conditions | 2 |
Paths | 1 |
Total Lines | 18 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 2.0438 |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
24 | 1 | public function macro(): Closure |
|
25 | { |
||
26 | 1 | return function (string $path, string $content, int $position = 0, array $options = []) { |
|
27 | /** |
||
28 | * @var FilesystemAdapter $this |
||
29 | */ |
||
30 | 1 | $adapter = new OssClientAdapter($this); |
|
31 | |||
32 | try { |
||
33 | 1 | return $adapter->client()->appendObject( |
|
34 | 1 | $adapter->bucket(), |
|
35 | 1 | $adapter->path($path), |
|
36 | $content, |
||
37 | $position, |
||
38 | 1 | $adapter->options($options) |
|
39 | ); |
||
40 | } catch (OssException $exception) { |
||
41 | throw new AliyunException($exception->getErrorMessage(), 0, $exception); |
||
42 | } |
||
46 |