<?php

namespace inpost_shipping\Model\Helper;

use GuzzleHttp\Psr7;
use Psr\Http\Message\ResponseInterface;

class InpostHelper
{
    /**
     * @param \Psr\Http\Message\ResponseInterface $response
     *
     * @return array
     */
    public static function decodeExceptionToArray(ResponseInterface $response): array
    {
        return json_decode(Psr7\Message::parseResponse(Psr7\Message::toString($response))->getBody()->getContents(), 1);
    }

}