Code Duplication    Length = 9-9 lines in 6 locations

src/Api/Custom.php 6 locations

@@ 17-25 (lines=9) @@
14
 */
15
final class Custom extends HttpApi
16
{
17
    public function get(string $path, array $params = [], array $requestHeaders = [], string $class = '')
18
    {
19
        $response = parent::httpGet($path, $params, $requestHeaders);
20
        if (!$this->hydrator) {
21
            return $response;
22
        }
23
24
        return $this->hydrator->hydrate($response, $class);
25
    }
26
27
    public function post(string $path, array $params = [], array $requestHeaders = [], string $class = '')
28
    {
@@ 27-35 (lines=9) @@
24
        return $this->hydrator->hydrate($response, $class);
25
    }
26
27
    public function post(string $path, array $params = [], array $requestHeaders = [], string $class = '')
28
    {
29
        $response = parent::httpPost($path, $params, $requestHeaders);
30
        if (!$this->hydrator) {
31
            return $response;
32
        }
33
34
        return $this->hydrator->hydrate($response, $class);
35
    }
36
37
    public function postRaw(string $path, $body, array $requestHeaders = [], string $class = '')
38
    {
@@ 37-45 (lines=9) @@
34
        return $this->hydrator->hydrate($response, $class);
35
    }
36
37
    public function postRaw(string $path, $body, array $requestHeaders = [], string $class = '')
38
    {
39
        $response = parent::httpPostRaw($path, $body, $requestHeaders);
40
        if (!$this->hydrator) {
41
            return $response;
42
        }
43
44
        return $this->hydrator->hydrate($response, $class);
45
    }
46
47
    public function put(string $path, array $params = [], array $requestHeaders = [], string $class = '')
48
    {
@@ 47-55 (lines=9) @@
44
        return $this->hydrator->hydrate($response, $class);
45
    }
46
47
    public function put(string $path, array $params = [], array $requestHeaders = [], string $class = '')
48
    {
49
        $response = parent::httpPut($path, $params, $requestHeaders);
50
        if (!$this->hydrator) {
51
            return $response;
52
        }
53
54
        return $this->hydrator->hydrate($response, $class);
55
    }
56
57
    public function patch(string $path, array $params = [], array $requestHeaders = [], string $class = '')
58
    {
@@ 57-65 (lines=9) @@
54
        return $this->hydrator->hydrate($response, $class);
55
    }
56
57
    public function patch(string $path, array $params = [], array $requestHeaders = [], string $class = '')
58
    {
59
        $response = parent::httpPatch($path, $params, $requestHeaders);
60
        if (!$this->hydrator) {
61
            return $response;
62
        }
63
64
        return $this->hydrator->hydrate($response, $class);
65
    }
66
67
    public function delete(string $path, array $params = [], array $requestHeaders = [], string $class = '')
68
    {
@@ 67-75 (lines=9) @@
64
        return $this->hydrator->hydrate($response, $class);
65
    }
66
67
    public function delete(string $path, array $params = [], array $requestHeaders = [], string $class = '')
68
    {
69
        $response = parent::httpDelete($path, $params, $requestHeaders);
70
        if (!$this->hydrator) {
71
            return $response;
72
        }
73
74
        return $this->hydrator->hydrate($response, $class);
75
    }
76
}
77