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

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