Code Duplication    Length = 9-10 lines in 3 locations

src/WrapIt/Helpers/WrapItLoginHelper.php 1 location

@@ 22-30 (lines=9) @@
19
20
    private $requester;
21
22
    public function __construct($wi) {
23
        if (!($wi instanceof WrapIt)) {
24
            throw new WrapItParameterException("WrapIt class required");
25
        }
26
27
        $this->client_id = $wi->getClientId();
28
        $this->client_secret = $wi->getClientSecret();
29
        $this->requester = new WrapItApiRequester($wi->getDomain());
30
    }
31
32
    public function generateLoginUrl($opt) {
33
        $opt = array_merge(array(

src/WrapIt/Helpers/WrapItUserHelper.php 1 location

@@ 24-33 (lines=10) @@
21
22
    private $requester;
23
24
    public function __construct($wi, $access_token) {
25
        if (!($wi instanceof WrapIt)) {
26
            throw new WrapItParameterException("WrapIt class required");
27
        }
28
29
        $this->client_id = $wi->getClientId();
30
        $this->client_secret = $wi->getClientSecret();
31
        $this->access_token = $access_token;
32
        $this->requester = new WrapItUserRequester($wi->getDomain(), $access_token);
33
    }
34
35
    public function getUserData($userid = "me") {
36
        $data = $this->requester->get("people/$userid");

src/WrapIt/Helpers/WrapItApiHelper.php 1 location

@@ 22-30 (lines=9) @@
19
20
    private $requester;
21
22
    public function __construct($wi) {
23
        if (!($wi instanceof WrapIt)) {
24
            throw new WrapItParameterException("WrapIt class required");
25
        }
26
27
        $this->client_id = $wi->getClientId();
28
        $this->client_secret = $wi->getClientSecret();
29
        $this->requester = new WrapItApiRequester($wi->getDomain());
30
    }
31
32
    public function request($api, $data) {
33
        return $this->requester->post($api, array_merge([