Code Duplication    Length = 14-14 lines in 2 locations

lib/ApiClient/Guzzle5ApiClient.php 1 location

@@ 48-61 (lines=14) @@
45
     *
46
     * @return string
47
     */
48
    protected function serializeResponse($response)
49
    {
50
        /** @var ResponseInterface $response */
51
        $serialized = serialize([
52
            $response->getStatusCode(),
53
            $response->getHeaders(),
54
            $response->getBody()->getContents(),
55
        ]);
56
57
        //subsequent calls need to access the stream from the beginning
58
        $response->getBody()->seek(0);
59
60
        return $serialized;
61
    }
62
63
    /**
64
     * Unserializes the serialized response into a ResponseInterface instance.

lib/ApiClient/Guzzle6ApiClient.php 1 location

@@ 38-51 (lines=14) @@
35
     *
36
     * @return string
37
     */
38
    protected function serializeResponse($response)
39
    {
40
        /** @var ResponseInterface $response */
41
        $serialized = serialize([
42
            $response->getStatusCode(),
43
            $response->getHeaders(),
44
            $response->getBody()->getContents(),
45
        ]);
46
47
        //subsequent calls need to access the stream from the beginning
48
        $response->getBody()->rewind();
49
50
        return $serialized;
51
    }
52
53
    /**
54
     * {@inheritdoc}