Code Duplication    Length = 10-10 lines in 2 locations

src/Client.php 2 locations

@@ 564-573 (lines=10) @@
561
     *
562
     * @return array
563
     */
564
    private function clientError(\GuzzleHttp\Exception\ClientException $exception)
565
    {
566
        $body = (string) $exception->getResponse()->getBody();
567
568
        return [
569
            'status'    => 'error',
570
            'http_code' => $exception->getResponse()->getStatusCode(),
571
            'body'      => json_decode($body),
572
        ];
573
    }
574
575
    /**
576
     * Parse the java exception that we receive from Smartcall's Tomcat's.
@@ 582-591 (lines=10) @@
579
     *
580
     * @return array
581
     */
582
    private function parseError(\GuzzleHttp\Exception\ServerException $exception)
583
    {
584
        $body = (string) $exception->getResponse()->getBody();
585
        preg_match('!<p><b>type</b> Exception report</p><p><b>message</b> <u>(.*[^</u>])</u></p><p><b>description</b>!', $body, $matches);
586
587
        return [
588
            'status'    => 'error',
589
            'http_code' => $exception->getResponse()->getStatusCode(),
590
            'body'      => $matches['1'],
591
        ];
592
    }
593
594
    /**