diff --git a/features/bootstrap/Aws/Test/Integ/MultipartContext.php b/features/bootstrap/Aws/Test/Integ/MultipartContext.php index 01cbd12..a1f7aa8 100644 --- a/features/bootstrap/Aws/Test/Integ/MultipartContext.php +++ b/features/bootstrap/Aws/Test/Integ/MultipartContext.php @@ -38,7 +38,7 @@ class MultipartContext implements Context, SnippetAcceptingContext */ public function iHaveASeekableReadStream() { - $this->stream = Psr7\stream_for(Psr7\try_fopen(self::$tempFile, 'r')); + $this->stream = Psr7\Utils::streamFor(Psr7\Utils::tryFopen(self::$tempFile, 'r')); } /** diff --git a/features/bootstrap/Aws/Test/Integ/S3Context.php b/features/bootstrap/Aws/Test/Integ/S3Context.php index ee65f75..eb2ae97 100644 --- a/features/bootstrap/Aws/Test/Integ/S3Context.php +++ b/features/bootstrap/Aws/Test/Integ/S3Context.php @@ -148,7 +148,7 @@ public function iSendThePreSignedRequest() public function iChangeTheBodyOfThePreSignedRequestToBe($body) { $this->presignedRequest = $this->presignedRequest - ->withBody(Psr7\stream_for($body)); + ->withBody(Psr7\Utils::streamFor($body)); } /** @@ -157,7 +157,7 @@ public function iChangeTheBodyOfThePreSignedRequestToBe($body) public function iHaveAnClientAndIHaveAFile() { $this->s3Client = self::getSdk()->createS3(); - $this->stream = Psr7\stream_for(Psr7\try_fopen(self::$tempFile, 'r')); + $this->stream = Psr7\Utils::streamFor(Psr7\Utils::tryFopen(self::$tempFile, 'r')); } /** diff --git a/features/bootstrap/Aws/Test/PerformanceContext.php b/features/bootstrap/Aws/Test/PerformanceContext.php index 4f0de3a..7cb6734 100644 --- a/features/bootstrap/Aws/Test/PerformanceContext.php +++ b/features/bootstrap/Aws/Test/PerformanceContext.php @@ -205,7 +205,7 @@ public function iUploadTheFile() public function thenDownloadTheFile() { $this->addMockResults($this->s3Client, [new Result([ - 'Body' => Psr7\stream_for(Psr7\try_fopen($this->tempFilePath, 'rb')), + 'Body' => Psr7\Utils::streamFor(Psr7\Utils::tryFopen($this->tempFilePath, 'rb')), ])]); $this->s3Client->getObject([ diff --git a/src/Signature/SignatureV2.php b/src/Signature/SignatureV2.php index 2712b4b..0df5a30 100644 --- a/src/Signature/SignatureV2.php +++ b/src/Signature/SignatureV2.php @@ -15,7 +15,7 @@ public function signRequest( RequestInterface $request, CredentialsInterface $credentials ) { - $params = Psr7\parse_query($request->getBody()); + $params = Psr7\Query::parse($request->getBody()); $params['Timestamp'] = gmdate('c'); $params['SignatureVersion'] = '2'; $params['SignatureMethod'] = 'HmacSHA256'; @@ -40,7 +40,7 @@ public function signRequest( ) ); - return $request->withBody(Psr7\stream_for(http_build_query($params))); + return $request->withBody(Psr7\Utils::streamFor(http_build_query($params))); } public function presign( diff --git a/tests/Signature/SignatureV2Test.php b/tests/Signature/SignatureV2Test.php index 415ee8a..2cd5598 100644 --- a/tests/Signature/SignatureV2Test.php +++ b/tests/Signature/SignatureV2Test.php @@ -32,7 +32,7 @@ public function testSignsRequestsWithSecurityToken() . "Host: foo.com\r\n" . "Content-Type: application/x-www-form-urlencoded\r\n\r\n" . "Test=123&Other=456&Timestamp=Fri%2C+09+Sep+2011+23%3A36%3A00+GMT&SignatureVersion=2&SignatureMethod=HmacSHA256&AWSAccessKeyId=AKIDEXAMPLE&SecurityToken=foo&Signature=NzQ9b5Kx6qlKj2UIK6QHIrmq5ypogh9PhBHVXKA4RU4%3D"; - $this->assertEquals($expected, Psr7\str($result)); + $this->assertEquals($expected, Psr7\Message::toString($result)); } public function testCanSignBodyWithStructureShapes() @@ -52,7 +52,7 @@ public function testCanSignBodyWithStructureShapes() . "Host: foo.com\r\n" . "Content-Type: application/x-www-form-urlencoded\r\n\r\n" . "Test=123&Other=456&Nested.1.Name=foo&Nested.1.Value=bar&Timestamp=Fri%2C+09+Sep+2011+23%3A36%3A00+GMT&SignatureVersion=2&SignatureMethod=HmacSHA256&AWSAccessKeyId=AKIDEXAMPLE&SecurityToken=foo&Signature=MbXBpe7leHe6O49B0CU86h%2By0GKFfQ9rBVCNvQWQlB0%3D"; - $this->assertEquals($expected, Psr7\str($result)); + $this->assertEquals($expected, Psr7\Message::toString($result)); } /**