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 ( 9b440d...f54447 )
by Nico
02:21
created

Touchpoint::Get()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 7
ccs 0
cts 0
cp 0
rs 9.4285
cc 2
eloc 4
nc 2
nop 2
crap 6
1
<?php
2
namespace Datatrics\API\Modules;
3
4
use Datatrics\API\Client;
5
6
class Touchpoint extends Base
7
{
8
    /**
9
     * Private constructor so only the client can create this
10
     * @param Client $client
11
     */
12 20
    public function __construct(Client $client)
13
    {
14 20
        parent::__construct($client);
15 20
        $this->SetUrl("/project/" . $this->GetClient()->GetProjectId() . "/touchpoint");
16 20
    }
17
18
    /**
19
     * Get one or multiple touchpoints
20
     * @param string touchpoint id, leave null for list of boxes
21
     * @param object Containing query arguments
22
     * @return object Result of the request
23
     */
24
    public function Get($touchpointId = null, $args = array("limit" => 50))
25
    {
26
        if (is_null($touchpointId)) {
27
            return $this->GetClient()->Get($this->GetUrl(), $args);
28
        }
29
        return $this->GetClient()->Get($this->GetUrl()."/".$touchpointId, $args);
30
    }
31
32
    /**
33
     * Create new touchpoint
34
     * @param object Containing all the information of a touchpoint
35
     * @return object Result of the request
36
     */
37
    public function Create($touchpoint)
38
    {
39
        return $this->GetClient()->Post($this->GetUrl(), $touchpoint);
40
    }
41
42
    /**
43
     * Update a touchpoint
44
     * @param id of the touchpoint
45
     * @param object Containing all the information of a touchpoint
46
     * @return object Result of the request
47
     */
48
    public function Update($touchpoint)
49
    {
50
        if (!isset($touchpoint['touchpointid'])) {
51
            throw new \Exception('touchpoint must contain touchpointid');
52
        }
53
        return $this->GetClient()->Put($this->GetUrl()."/".$touchpoint['touchpointid'], $touchpoint);
54
    }
55
56
    /**
57
     * Delete a touchpoint object by touchpoint id
58
     * @param string Id of the touchpoint
59
     * @return object Result of the request
60
     */
61
    public function Delete($touchpointId)
62
    {
63
        return $this->GetClient()->Delete($this->GetUrl()."/".$touchpointId);
64
    }
65
66
    /**
67
     * Retrieve stats a touchpoint object by touchpoint id
68
     * @param string Id of the touchpoint
69
     * @return object Result of the request
70
     */
71
    public function Stats($touchpointId, $args = [])
72
    {
73
        return $this->GetClient()->Get($this->GetUrl()."/".$touchpointId."/stats", $args);
74
    }
75
76
    /**
77
     * Retrieve content of a touchpoint object by touchpoint id
78
     * @param string Id of the touchpoint
79
     * @return object Result of the request
80
     */
81
    public function Content($touchpointId, $args = [])
82
    {
83
        return $this->GetClient()->Get($this->GetUrl()."/".$touchpointId."/content", $args);
84
    }
85
}
86