diff --git a/.travis.yml b/.travis.yml index 1dfbb818..82479e7a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ language: php php: - - 5.6 + - 7.3 notifications: email: recipients: diff --git a/composer.json b/composer.json index 6eecca14..f9087db1 100644 --- a/composer.json +++ b/composer.json @@ -21,8 +21,8 @@ } }, "require": { - "php": ">=5.3.0", - "guzzlehttp/guzzle": "~6.3", - "guzzlehttp/guzzle-services": "~1.1" + "php": ">=7.3", + "guzzlehttp/guzzle": "^7.0.1", + "guzzlehttp/guzzle-services": "~1.2" } } diff --git a/src/Qcloud/Cos/Client.php b/src/Qcloud/Cos/Client.php index 77d94bc6..0f3d3f2f 100644 --- a/src/Qcloud/Cos/Client.php +++ b/src/Qcloud/Cos/Client.php @@ -75,7 +75,7 @@ * @method object SelectObjectContent (array $arg) */ class Client extends GuzzleClient { - const VERSION = '2.1.2'; + const VERSION = '3.0.0'; public $httpClient; @@ -212,7 +212,7 @@ public function getObjectUrl($bucket, $key, $expires = "+30 minutes", array $arg } public function upload($bucket, $key, $body, $options = array()) { - $body = Psr7\stream_for($body); + $body = Psr7\Utils::streamFor($body); $options['PartSize'] = isset($options['PartSize']) ? $options['PartSize'] : MultipartUpload::DEFAULT_PART_SIZE; if ($body->getSize() < $options['PartSize']) { $rt = $this->putObject(array( @@ -233,7 +233,7 @@ public function upload($bucket, $key, $body, $options = array()) { } public function resumeUpload($bucket, $key, $body, $uploadId, $options = array()) { - $body = Psr7\stream_for($body); + $body = Psr7\Utils::streamFor($body); $options['PartSize'] = isset($options['PartSize']) ? $options['PartSize'] : MultipartUpload::DEFAULT_PART_SIZE; $multipartUpload = new MultipartUpload($this, $body, array( 'Bucket' => $bucket, diff --git a/src/Qcloud/Cos/Request/BodyLocation.php b/src/Qcloud/Cos/Request/BodyLocation.php index 90f97a54..73787fd5 100644 --- a/src/Qcloud/Cos/Request/BodyLocation.php +++ b/src/Qcloud/Cos/Request/BodyLocation.php @@ -44,6 +44,6 @@ public function visit( } // binary string data from bound parameter $value = $command[$param->getName()]; - return $request->withBody(Psr7\stream_for($value)); + return $request->withBody(Psr7\Utils::streamFor($value)); } } diff --git a/src/Qcloud/Cos/Tests/COSTest.php b/src/Qcloud/Cos/Tests/COSTest.php index b02b82f6..3e038202 100644 --- a/src/Qcloud/Cos/Tests/COSTest.php +++ b/src/Qcloud/Cos/Tests/COSTest.php @@ -10,8 +10,7 @@ class COSTest extends \PHPUnit\Framework\TestCase private $cosClient; private $bucket; private $region; - protected function setUp() - { + protected function setUp(): void { $this->bucket = getenv('COS_BUCKET'); $this->region = getenv('COS_REGION'); $this->bucket2 = "tmp".$this->bucket; @@ -25,7 +24,7 @@ protected function setUp() } } - protected function tearDown() { + protected function tearDown(): void { } function generateRandomString($length = 10) { @@ -718,7 +717,6 @@ public function testGetBucketCorsNull() 'Bucket' => $this->bucket ) ); - print_r($rt); $this->assertTrue(False); } catch (ServiceResponseException $e) { $this->assertTrue($e->getExceptionCode() === 'NoSuchCORSConfiguration' && $e->getStatusCode() === 404);