Skip to content

Commit 03fb190

Browse files
authored
Merge pull request #241 from it-can/main
Replace deprecated rewind_body with Message::rewindBody
2 parents 3be9692 + 9dcf9da commit 03fb190

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/Picqer/Financials/Moneybird/Connection.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ public function needsAuthentication()
414414
private function parseResponse(Response $response)
415415
{
416416
try {
417-
Psr7\rewind_body($response);
417+
Psr7\Message::rewindBody($response);
418418
$json = json_decode($response->getBody()->getContents(), true);
419419

420420
return $json;
@@ -477,7 +477,7 @@ private function acquireAccessToken()
477477
$response = $this->client()->post($this->getTokenUrl(), $body);
478478

479479
if ($response->getStatusCode() == 200) {
480-
Psr7\rewind_body($response);
480+
Psr7\Message::rewindBody($response);
481481
$body = json_decode($response->getBody()->getContents(), true);
482482

483483
if (json_last_error() === JSON_ERROR_NONE) {
@@ -512,7 +512,7 @@ private function parseExceptionForErrorMessages(Exception $exception)
512512
return new ApiException('Response is NULL.', 0, $exception);
513513
}
514514

515-
Psr7\rewind_body($response);
515+
Psr7\Message::rewindBody($response);
516516
$responseBody = $response->getBody()->getContents();
517517
$decodedResponseBody = json_decode($responseBody, true);
518518

tests/ConnectionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public function testClientTriesToGetAccessTokenWhenNoneGiven()
112112
$request = $this->getRequestFromHistoryContainer();
113113
$this->assertEquals('POST', $request->getMethod());
114114

115-
Psr7\rewind_body($request);
115+
Psr7\Message::rewindBody($request);
116116
$this->assertEquals(
117117
'redirect_uri=testRedirectUrl&grant_type=authorization_code&client_id=testClientId&client_secret=testClientSecret&code=testAuthorizationCode',
118118
$request->getBody()->getContents()

0 commit comments

Comments
 (0)