| Total Complexity | 7 |
| Total Lines | 45 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 20 | class UpyunAdapter extends Adapter |
||
| 21 | { |
||
| 22 | |||
| 23 | public $accessId; |
||
| 24 | public $accessSecret; |
||
| 25 | public $bucket; |
||
| 26 | public $domain; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * @inheritdoc |
||
| 30 | */ |
||
| 31 | public function init() |
||
| 32 | { |
||
| 33 | if ($this->accessId === null) { |
||
| 34 | throw new InvalidConfigException('The "accessId" property must be set.'); |
||
| 35 | } |
||
| 36 | |||
| 37 | if ($this->accessSecret === null) { |
||
| 38 | throw new InvalidConfigException('The "accessSecret" property must be set.'); |
||
| 39 | } |
||
| 40 | |||
| 41 | if ($this->bucket === null) { |
||
| 42 | throw new InvalidConfigException('The "bucket" property must be set.'); |
||
| 43 | } |
||
| 44 | if ($this->domain === null) { |
||
| 45 | throw new InvalidConfigException('The "domain" property must be set.'); |
||
| 46 | } |
||
| 47 | parent::init(); |
||
| 48 | } |
||
| 49 | |||
| 50 | /** |
||
| 51 | * @inheritdoc |
||
| 52 | */ |
||
| 53 | public static function displayName(): string |
||
| 54 | { |
||
| 55 | return Yii::t('yuncms', 'Upyun'); |
||
| 56 | } |
||
| 57 | |||
| 58 | /** |
||
| 59 | * 准备适配器 |
||
| 60 | * @return \JellyBool\Flysystem\Upyun\UpyunAdapter |
||
| 61 | */ |
||
| 62 | protected function prepareAdapter() |
||
| 65 | } |
||
| 66 | } |