Code Duplication    Length = 8-8 lines in 2 locations

lib/GitHub/AbstractApi.php 2 locations

@@ 575-582 (lines=8) @@
572
                break;
573
        }
574
575
        $curl->success(function (CurlClient $instance) {
576
            $this->headers = $instance->getHeaders();
577
            $this->success = $instance->getResponse();
578
            $data          = json_decode($this->success, true);
579
            if (JSON_ERROR_NONE === json_last_error()) {
580
                $this->success = $data;
581
            }
582
        });
583
        $curl->error(function (CurlClient $instance) {
584
            $this->headers = $instance->getHeaders();
585
            $this->failure = $instance->getResponse();
@@ 583-590 (lines=8) @@
580
                $this->success = $data;
581
            }
582
        });
583
        $curl->error(function (CurlClient $instance) {
584
            $this->headers = $instance->getHeaders();
585
            $this->failure = $instance->getResponse();
586
            $data          = json_decode($this->failure, true);
587
            if (JSON_ERROR_NONE === json_last_error()) {
588
                $this->failure = $data;
589
            }
590
        });
591
        $curl->perform();
592
593
        return (array)($this->success ?? $this->failure);