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.

Card::Update()   A
last analyzed

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 4
cp 0
rs 9.4285
cc 2
eloc 4
nc 2
nop 1
crap 6
1
<?php
2
namespace Datatrics\API\Modules;
3
4
use Datatrics\API\Client;
5
6
class Card extends Base
7
{
8
    /**
9
     * Private constructor so only the client can create this
10
     * @param Client $client
11
     */
12 16
    public function __construct(Client $client)
13
    {
14 16
        parent::__construct($client);
15 16
        $this->SetUrl("/project/" . $this->GetClient()->GetProjectId() . "/card");
16 16
    }
17
18
    /**
19
     * Get one or multiple cards
20
     * @param string card 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($cardId = null, $args = array("limit" => 50))
25
    {
26
        if (is_null($cardId)) {
27
            return $this->GetClient()->Get($this->GetUrl(), $args);
28
        }
29
        return $this->GetClient()->Get($this->GetUrl()."/".$cardId, $args);
30
    }
31
32
    /**
33
     * Create new card
34
     * @param object Containing all the information of a card
35
     * @return object Result of the request
36
     */
37
    public function Create($card)
38
    {
39
        return $this->GetClient()->Post($this->GetUrl(), $card);
40
    }
41
42
    /**
43
     * Update a card
44
     * @param object Containing all the information of a card
45
     * @return object Result of the request
46
     */
47
    public function Update($card)
48
    {
49
        if (!isset($card['cardid'])) {
50
            throw new \Exception("card must contain a cardid");
51
        }
52
        return $this->GetClient()->Put($this->GetUrl()."/".$card['cardid'], $card);
53
    }
54
}
55