File tree 2 files changed +4
-5
lines changed
src/Picqer/Financials/Moneybird
2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -420,7 +420,7 @@ public function needsAuthentication()
420
420
private function parseResponse (Response $ response )
421
421
{
422
422
try {
423
- Psr7 \Message:: rewindBody ( $ response );
423
+ $ response-> getBody ()-> rewind ( );
424
424
$ json = json_decode ($ response ->getBody ()->getContents (), true );
425
425
426
426
return $ json ;
@@ -483,7 +483,7 @@ private function acquireAccessToken()
483
483
$ response = $ this ->client ()->post ($ this ->getTokenUrl (), $ body );
484
484
485
485
if ($ response ->getStatusCode () == 200 ) {
486
- Psr7 \Message:: rewindBody ( $ response );
486
+ $ response-> getBody ()-> rewind ( );
487
487
$ body = json_decode ($ response ->getBody ()->getContents (), true );
488
488
489
489
if (json_last_error () === JSON_ERROR_NONE ) {
@@ -517,7 +517,7 @@ private function parseExceptionForErrorMessages(Exception $exception)
517
517
return new ApiException ('Response is NULL. ' , 0 , $ exception );
518
518
}
519
519
520
- Psr7 \Message:: rewindBody ( $ response );
520
+ $ response-> getBody ()-> rewind ( );
521
521
$ responseBody = $ response ->getBody ()->getContents ();
522
522
$ decodedResponseBody = json_decode ($ responseBody , true );
523
523
Original file line number Diff line number Diff line change 5
5
use GuzzleHttp \Exception \BadResponseException ;
6
6
use GuzzleHttp \Middleware ;
7
7
use GuzzleHttp \Promise \PromiseInterface ;
8
- use GuzzleHttp \Psr7 ;
9
8
use PHPUnit \Framework \TestCase ;
10
9
use Picqer \Financials \Moneybird \Connection ;
11
10
use Picqer \Financials \Moneybird \Entities \Contact ;
@@ -110,7 +109,7 @@ public function testClientTriesToGetAccessTokenWhenNoneGiven()
110
109
$ request = $ this ->getRequestFromHistoryContainer ();
111
110
$ this ->assertEquals ('POST ' , $ request ->getMethod ());
112
111
113
- Psr7 \Message:: rewindBody ( $ request );
112
+ $ request-> getBody ()-> rewind ( );
114
113
$ this ->assertEquals (
115
114
'redirect_uri=testRedirectUrl&grant_type=authorization_code&client_id=testClientId&client_secret=testClientSecret&code=testAuthorizationCode ' ,
116
115
$ request ->getBody ()->getContents ()
You can’t perform that action at this time.
0 commit comments