Code Duplication    Length = 8-8 lines in 3 locations

src/Api/HttpApi.php 3 locations

@@ 124-131 (lines=8) @@
121
     *
122
     * @return ResponseInterface
123
     */
124
    protected function httpPut(string $path, array $params = [], array $requestHeaders = []): ResponseInterface
125
    {
126
        $requestHeaders['Content-Type'] = 'application/x-www-form-urlencoded';
127
128
        return $this->httpClient->sendRequest(
129
            $this->requestBuilder->create('PUT', $path, $requestHeaders, http_build_query($params))
130
        );
131
    }
132
133
    /**
134
     * Send a DELETE request with JSON-encoded parameters.
@@ 144-151 (lines=8) @@
141
     *
142
     * @return ResponseInterface
143
     */
144
    protected function httpDelete(string $path, array $params = [], array $requestHeaders = []): ResponseInterface
145
    {
146
        $requestHeaders['Content-Type'] = 'application/x-www-form-urlencoded';
147
148
        return $this->httpClient->sendRequest(
149
            $this->requestBuilder->create('DELETE', $path, $requestHeaders, http_build_query($params))
150
        );
151
    }
152
153
    /**
154
     * Send a PATCH request with json encoded data.
@@ 164-171 (lines=8) @@
161
     *
162
     * @return ResponseInterface
163
     */
164
    protected function httpPatch(string $path, $body, array $requestHeaders = []): ResponseInterface
165
    {
166
        $requestHeaders['Content-Type'] = 'application/json';
167
168
        return $this->httpClient->sendRequest(
169
            $this->requestBuilder->create('PATCH', $path, $requestHeaders, json_encode($body))
170
        );
171
    }
172
173
    /**
174
     * Handle HTTP errors.