Code Duplication    Length = 10-10 lines in 7 locations

src/HttpCallsTrait.php 3 locations

@@ 54-63 (lines=10) @@
51
     *
52
     * @return ResponseInterface
53
     */
54
    protected function post(
55
        string $uri,
56
        array $data = [],
57
        array $headers = [],
58
        array $cookies = []
59
    ): ResponseInterface {
60
        $headers['CONTENT_TYPE'] = 'application/x-www-form-urlencoded';
61
62
        return $this->call('POST', $uri, [], $data, $headers, $cookies);
63
    }
64
65
    /**
66
     * @param string $uri
@@ 73-82 (lines=10) @@
70
     *
71
     * @return ResponseInterface
72
     */
73
    protected function put(
74
        string $uri,
75
        array $data = [],
76
        array $headers = [],
77
        array $cookies = []
78
    ): ResponseInterface {
79
        $headers['CONTENT_TYPE'] = 'application/x-www-form-urlencoded';
80
81
        return $this->call('PUT', $uri, [], $data, $headers, $cookies);
82
    }
83
84
    /**
85
     * @param string $uri
@@ 92-101 (lines=10) @@
89
     *
90
     * @return ResponseInterface
91
     */
92
    protected function patch(
93
        string $uri,
94
        array $data = [],
95
        array $headers = [],
96
        array $cookies = []
97
    ): ResponseInterface {
98
        $headers['CONTENT_TYPE'] = 'application/x-www-form-urlencoded';
99
100
        return $this->call('PATCH', $uri, [], $data, $headers, $cookies);
101
    }
102
103
    /**
104
     * @param string $uri

src/JsonApiCallsTrait.php 4 locations

@@ 39-48 (lines=10) @@
36
     *
37
     * @return ResponseInterface
38
     */
39
    protected function postJsonApi(
40
        string $uri,
41
        string $json,
42
        array $headers = [],
43
        array $cookies = []
44
    ): ResponseInterface {
45
        $headers['CONTENT_TYPE'] = 'application/vnd.api+json';
46
47
        return $this->call('POST', $uri, [], [], $headers, $cookies, [], [], $this->streamFromString($json));
48
    }
49
50
    /**
51
     * @param string $uri
@@ 58-67 (lines=10) @@
55
     *
56
     * @return ResponseInterface
57
     */
58
    protected function putJsonApi(
59
        string $uri,
60
        string $json,
61
        array $headers = [],
62
        array $cookies = []
63
    ): ResponseInterface {
64
        $headers['CONTENT_TYPE'] = 'application/vnd.api+json';
65
66
        return $this->call('PUT', $uri, [], [], $headers, $cookies, [], [], $this->streamFromString($json));
67
    }
68
69
    /**
70
     * @param string $uri
@@ 77-86 (lines=10) @@
74
     *
75
     * @return ResponseInterface
76
     */
77
    protected function patchJsonApi(
78
        string $uri,
79
        string $json,
80
        array $headers = [],
81
        array $cookies = []
82
    ): ResponseInterface {
83
        $headers['CONTENT_TYPE'] = 'application/vnd.api+json';
84
85
        return $this->call('PATCH', $uri, [], [], $headers, $cookies, [], [], $this->streamFromString($json));
86
    }
87
88
    /**
89
     * @param string $uri
@@ 96-105 (lines=10) @@
93
     *
94
     * @return ResponseInterface
95
     */
96
    protected function deleteJsonApi(
97
        string $uri,
98
        string $json,
99
        array $headers = [],
100
        array $cookies = []
101
    ): ResponseInterface {
102
        $headers['CONTENT_TYPE'] = 'application/vnd.api+json';
103
104
        return $this->call('DELETE', $uri, [], [], $headers, $cookies, [], [], $this->streamFromString($json));
105
    }
106
107
    /**
108
     * @param string $content