Code Duplication    Length = 12-12 lines in 2 locations

src/V1/OmsApi.php 1 location

@@ 95-106 (lines=12) @@
92
        return (string) $result->getBody();
93
    }
94
95
    private function handleRequestException(\Throwable $exception): OmsClientExceptionInterface
96
    {
97
        if ($exception instanceof BadResponseException) {
98
            $response = $exception->getResponse();
99
            $responseBody = $response ? (string) $response->getBody() : '';
100
            $responseCode = $response ? $response->getStatusCode() : 0;
101
102
            return OmsRequestErrorException::becauseOfError($responseCode, $responseBody, $exception);
103
        }
104
105
        return OmsGeneralErrorException::becauseOfError($exception);
106
    }
107
}
108

src/V2/OmsApi.php 1 location

@@ 153-164 (lines=12) @@
150
        return (string)$result->getBody();
151
    }
152
153
    private function handleRequestException(\Throwable $exception): OmsClientExceptionInterface
154
    {
155
        if ($exception instanceof BadResponseException) {
156
            $response = $exception->getResponse();
157
            $responseBody = $response ? (string)$response->getBody() : '';
158
            $responseCode = $response ? $response->getStatusCode() : 0;
159
160
            return OmsRequestErrorException::becauseOfError($responseCode, $responseBody, $exception);
161
        }
162
163
        return OmsGeneralErrorException::becauseOfError($exception);
164
    }
165
166
    private function appendSignatureHeader(array $headers, string $data, SignerInterface $signer = null): array
167
    {