Code Duplication    Length = 8-9 lines in 3 locations

src/base/Service.php 3 locations

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