Code Duplication    Length = 8-9 lines in 3 locations

src/base/Service.php 3 locations

@@ 306-313 (lines=8) @@
303
            default:
304
                $this->addOption(CURLOPT_CUSTOMREQUEST, "GET");
305
                break;
306
            case 'POST':
307
                $this->addOption(CURLOPT_CUSTOMREQUEST, "POST");
308
                if($this->getIsJson()) {
309
                    $this->addOption(CURLOPT_POSTFIELDS, json_encode($this->params));
310
                } else {
311
                    $this->addOption(CURLOPT_POSTFIELDS, http_build_query($this->params));
312
                }
313
                break;
314
            case 'DELETE':
315
                $this->addOption(CURLOPT_CUSTOMREQUEST, "DELETE");
316
                break;
@@ 317-325 (lines=9) @@
314
            case 'DELETE':
315
                $this->addOption(CURLOPT_CUSTOMREQUEST, "DELETE");
316
                break;
317
            case 'PUT':
318
                $this->addOption(CURLOPT_CUSTOMREQUEST, "PUT");
319
320
                if($this->getIsJson()) {
321
                    $this->addOption(CURLOPT_POSTFIELDS, json_encode($this->params));
322
                } else {
323
                    $this->addOption(CURLOPT_POSTFIELDS, http_build_query($this->params));
324
                }
325
                break;
326
            case 'PATCH':
327
                $this->addOption(CURLOPT_CUSTOMREQUEST, "PATCH");
328
                if($this->getIsJson()) {
@@ 326-333 (lines=8) @@
323
                    $this->addOption(CURLOPT_POSTFIELDS, http_build_query($this->params));
324
                }
325
                break;
326
            case 'PATCH':
327
                $this->addOption(CURLOPT_CUSTOMREQUEST, "PATCH");
328
                if($this->getIsJson()) {
329
                    $this->addOption(CURLOPT_POSTFIELDS, json_encode($this->params));
330
                } else {
331
                    $this->addOption(CURLOPT_POSTFIELDS, http_build_query($this->params));
332
                }
333
                break;
334
        }
335
336
        $this->addOption(CURLOPT_RETURNTRANSFER, true);