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.
Passed
Push — 2.0 ( 4b0ab2...40b088 )
by Nico
06:03
created

Tric::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 2
1
<?php
2
namespace Datatrics\API\Modules;
3
4
class Tric 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 . "/tric");
14
    }
15
16
    /**
17
     * Get one or multiple trics
18
     * @param string tric 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($tricId = null, $args = array("limit" => 50))
23
    {
24
        return $tricId == null ? $this->request(self::HTTP_GET, "?".http_build_query($args)) : $this->request(self::HTTP_GET, "/".$tricId."?".http_build_query($args));
25
    }
26
27
    /**
28
     * Create new tric
29
     * @param object Containing all the information of a tric
30
     * @return object Result of the request
31
     */
32
    public function Create($tric)
33
    {
34
        return $this->request(self::HTTP_POST, "", $tric);
35
    }
36
37
    /**
38
     * Update a tric
39
     * @param id of the tric
40
     * @param object Containing all the information of a tric
41
     * @return object Result of the request
42
     */
43
    public function Update($tric)
44
    {
45
        if (!isset($tric['tricid'])) {
46
            throw new \Exception('tric must contain tricid');
47
        }
48
        return $this->request(self::HTTP_PUT, "/".$tric['tricid'], $tric);
49
    }
50
51
    /**
52
     * Delete a tric object by tric id
53
     * @param string Id of the tric
54
     * @return object Result of the request
55
     */
56
    public function Delete($tricId)
57
    {
58
        return $this->request(self::HTTP_DELETE, "/".$tricId);
59
    }
60
61
    /**
62
     * Do a tric object by tric id.
63
     * @param string Id of the tric
64
     * @return object Result of the request
65
     */
66
    public function Run($tricId)
67
    {
68
        return $this->request(self::HTTP_GET, "/".$tricId);
69
    }
70
}
71