Code Duplication    Length = 14-14 lines in 5 locations

src/EntryPoint/Abstracts/DELETE/AbstractDeleteEntryPoint.php 1 location

@@ 10-23 (lines=14) @@
7
use SugarAPI\SDK\Request\DELETE;
8
use SugarAPI\SDK\Response\JSON;
9
10
abstract class AbstractDeleteEntryPoint extends AbstractEntryPoint {
11
12
    public function __construct($url, array $options = array()) {
13
        $this->setRequest(new DELETE());
14
        parent::__construct($url, $options);
15
    }
16
17
    public function execute($data = NULL) {
18
        parent::execute($data);
19
        $this->setResponse(new JSON($this->Request->getResponse(),$this->Request->getCurlObject()));
20
        return $this;
21
    }
22
23
}

src/EntryPoint/Abstracts/GET/AbstractGetEntryPoint.php 1 location

@@ 9-22 (lines=14) @@
6
use SugarAPI\SDK\Request\GET;
7
use SugarAPI\SDK\Response\JSON;
8
9
abstract class AbstractGetEntryPoint extends AbstractEntryPoint {
10
11
    public function __construct($url, array $options = array()) {
12
        $this->setRequest(new GET());
13
        parent::__construct($url, $options);
14
    }
15
16
    public function execute($data = null) {
17
        parent::execute($data);
18
        $this->setResponse(new JSON($this->Request->getResponse(),$this->Request->getCurlObject()));
19
        return $this;
20
    }
21
22
}

src/EntryPoint/Abstracts/POST/AbstractPostEntryPoint.php 1 location

@@ 9-22 (lines=14) @@
6
use SugarAPI\SDK\Request\POST;
7
use SugarAPI\SDK\Response\JSON;
8
9
abstract class AbstractPostEntryPoint extends AbstractEntryPoint {
10
11
    public function __construct($url, array $options = array()) {
12
        $this->setRequest(new POST());
13
        parent::__construct($url, $options);
14
    }
15
16
    public function execute($data = null) {
17
        parent::execute($data);
18
        $this->setResponse(new JSON($this->Request->getResponse(),$this->Request->getCurlObject()));
19
        return $this;
20
    }
21
22
}

src/EntryPoint/Abstracts/POST/AbstractPostFileEntryPoint.php 1 location

@@ 9-22 (lines=14) @@
6
use SugarAPI\SDK\Request\POSTFile;
7
use SugarAPI\SDK\Response\JSON;
8
9
abstract class AbstractPostFileEntryPoint extends AbstractEntryPoint {
10
11
    public function __construct($url, array $options = array()){
12
        $this->setRequest(new POSTFile());
13
        parent::__construct($url, $options);
14
    }
15
16
    public function execute($data = null){
17
        parent::execute($data);
18
        $this->setResponse(new JSON($this->Request->getResponse(), $this->Request->getCurlObject()));
19
        return $this;
20
    }
21
22
}

src/EntryPoint/Abstracts/PUT/AbstractPutEntryPoint.php 1 location

@@ 9-22 (lines=14) @@
6
use SugarAPI\SDK\Request\PUT;
7
use SugarAPI\SDK\Response\JSON;
8
9
abstract class AbstractPutEntryPoint extends AbstractEntryPoint {
10
11
    public function __construct($url, array $options = array()) {
12
        $this->setRequest(new PUT());
13
        parent::__construct($url, $options);
14
    }
15
16
    public function execute($data = null) {
17
        parent::execute($data);
18
        $this->setResponse(new JSON($this->Request->getResponse(),$this->Request->getCurlObject()));
19
        return $this;
20
    }
21
22
}