private function getResult($response)
    {
        $status = $response->getStatusCode();
        if ($status == 200) {
            return json_decode($response->getBody(), JSON_PRETTY_PRINT);
        } else {
            return [$status => $response->getReasonPhrase()];
        }
    }
private function getResult($response)
    {
        $status = $response->getStatusCode();
        if ($status == 200) {
            return json_decode($response->getBody(), JSON_PRETTY_PRINT);
        } else {
            return [$status => $response->getReasonPhrase()];
        }
    }
private function getResult ( $ response ) { $ status = $ response -> getStatusCode ( ) ; if ( $ status == 200 ) { return json_decode ( $ response -> getBody ( ) , JSON_PRETTY_PRINT ) ; } else { return [ $ status => $ response -> getReasonPhrase ( ) ] ; } }
Get a request result.
Returns an array with a response body or and error code => reason.
@param \GuzzleHttp\Psr7\Response $response
@return array|mixed
Get a request result . Returns an array with a response body or and error code = > reason .