Code Duplication    Length = 10-11 lines in 3 locations

src/WrapIt/Http/WrapItPushRequester.php 1 location

@@ 25-35 (lines=11) @@
22
        throw new WrapItParameterException("GET not alowed with this requester");
23
    }
24
25
    public function post($api, $data) {
26
        $api = ltrim($api, "/");
27
        return $this->request(array(
28
            "url" => "https://" . $this->domain . "/" . $api,
29
            "post" => $data,
30
            "body_type" => "applicaton/json",
31
            "headers" => array(
32
                "Authorization: Bearer " . $this->access_token
33
            )
34
        ));
35
    }
36
37
}
38

src/WrapIt/Http/WrapItUserRequester.php 2 locations

@@ 19-28 (lines=10) @@
16
        $this->access_token = $token;
17
    }
18
19
    public function get($api, $data = array()) {
20
        $api = ltrim($api, "/");
21
        return $this->request(array(
22
            "url" => "https://" . $this->domain . "/" . $api,
23
            "get" => $data,
24
            "headers" => array(
25
                "Authorization: Bearer " . $this->access_token
26
            )
27
        ));
28
    }
29
30
    public function post($api, $data) {
31
        $api = ltrim($api, "/");
@@ 30-39 (lines=10) @@
27
        ));
28
    }
29
30
    public function post($api, $data) {
31
        $api = ltrim($api, "/");
32
        return $this->request(array(
33
            "url" => "https://" . $this->domain . "/" . $api,
34
            "post" => $data,
35
            "headers" => array(
36
                "Authorization: Bearer " . $this->access_token
37
            )
38
        ));
39
    }
40
41
}
42