Skip to content

Commit

Permalink
fixed:php 8.0兼容
Browse files Browse the repository at this point in the history
`SendRequestTrait::createCommonSignedUrl(array $args=[],$signature)`在php8.0中会导致以下错误`Required parameter $signature follows optional parameter $args`
  • Loading branch information
liuqiandev authored Jan 13, 2022
1 parent d9321bc commit 52040c3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Obs/Internal/SendRequestTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,14 @@ public function createSignedUrl(array $args=[]){
if (strcasecmp($this -> signature, 'v4') === 0) {
return $this -> createV4SignedUrl($args);
}
return $this->createCommonSignedUrl($args, $this->signature);
return $this->createCommonSignedUrl($this->signature,$args);
}

public function createV2SignedUrl(array $args=[]) {
return $this->createCommonSignedUrl($args, 'v2');
return $this->createCommonSignedUrl( 'v2',$args);
}

private function createCommonSignedUrl(array $args=[], $signature) {
private function createCommonSignedUrl(string $signature,array $args=[]) {
if(!isset($args['Method'])){
$obsException = new ObsException('Method param must be specified, allowed values: GET | PUT | HEAD | POST | DELETE | OPTIONS');
$obsException-> setExceptionType('client');
Expand Down Expand Up @@ -715,4 +715,4 @@ function (RequestException $exception) use ($model, $operation, $params, $callba
}
);
}
}
}

0 comments on commit 52040c3

Please sign in to comment.