GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — 2.0 ( fb4bbc...dcdbd9 )
by Nico
29:09 queued 02:20
created

Touchpoint   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 68
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 8
lcom 1
cbo 1
dl 0
loc 68
rs 10
c 0
b 0
f 0

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A Get() 0 4 2
A Create() 0 4 1
A Update() 0 4 1
A Delete() 0 4 1
A Stats() 0 8 2
1
<?php
2
namespace Datatrics\API\Modules;
3
4
class Touchpoint extends Base
5
{
6
    /**
7
     * Private constructor so only the client can create this
8
     * @param string $apikey
9
     * @param string $projectid
10
     */
11
    public function __construct($apikey, $projectid)
12
    {
13
        parent::__construct($apikey, "/project/" . $projectid . "/touchpoint");
14
    }
15
16
    /**
17
     * Get one or multiple touchpoints
18
     * @param string touchpoint id, leave null for list of boxes
19
     * @param object Containing query arguments
20
     * @return object Result of the request
21
     */
22
    public function Get($touchpointId = null, $args = array("limit" => 50))
23
    {
24
        return $touchpointId == null ? $this->request(self::HTTP_GET, "?".http_build_query($args)) : $this->request(self::HTTP_GET, "/".$touchpointId."?".http_build_query($args));
25
    }
26
27
    /**
28
     * Create new touchpoint
29
     * @param object Containing all the information of a touchpoint
30
     * @return object Result of the request
31
     */
32
    public function Create($touchpoint)
33
    {
34
        return $this->request(self::HTTP_POST, "", $touchpoint);
35
    }
36
37
    /**
38
     * Create new touchpoint
39
     * @param id of the touchpoint
40
     * @param object Containing all the information of a touchpoint
41
     * @return object Result of the request
42
     */
43
    public function Update($touchpointId, $touchpoint)
44
    {
45
        return $this->request(self::HTTP_PUT, "/".$touchpointId, $touchpoint);
46
    }
47
48
    /**
49
     * Delete a touchpoint object by touchpoint id
50
     * @param string Id of the touchpoint
51
     * @return object Result of the request
52
     */
53
    public function Delete($touchpointId)
54
    {
55
        return $this->request(self::HTTP_DELETE, "/".$touchpointId);
56
    }
57
58
    /**
59
     * Delete a touchpoint object by touchpoint id
60
     * @param string Id of the touchpoint
61
     * @return object Result of the request
62
     */
63
    public function Stats($touchpointId, $args)
64
    {
65
        if (count($args)) {
66
            return $this->request(self::HTTP_GET, "/".$touchpointId."/stats?".http_build_query($args));
67
        } else {
68
            return $this->request(self::HTTP_GET, "/".$touchpointId."/stats");
69
        }
70
    }
71
}
72