TrelloClient::setApiKey()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 1
crap 1
1
<?php
2
3
namespace TrelloBurndown\Client;
4
5
use Trello\Client;
6
7
/**
8
 * Class TrelloClient.
9
 */
10
class TrelloClient
11
{
12
    /**
13
     * @var string
14
     */
15
    private $apiKey;
16
    /**
17
     * @var string
18
     */
19
    private $apiToken;
20
    /**
21
     * @var Client
22
     */
23
    protected $client;
24
25
    /**
26
     * TrelloManager constructor.
27
     *
28
     * @param string $apiKey
29
     * @param string $apiToken
30
     */
31 2
    public function __construct(String $apiKey, String $apiToken)
32
    {
33 2
        $this->apiKey = $apiKey;
34 2
        $this->apiToken = $apiToken;
35 2
        $this->setClient();
36 2
    }
37
38
    /**
39
     * @param string $apiKey
40
     */
41 1
    public function setApiKey(String $apiKey)
42
    {
43 1
        $this->apiKey = $apiKey;
44 1
    }
45
46
    /**
47
     * @param string $apiToken
48
     */
49 1
    public function setApiToken(String $apiToken)
50
    {
51 1
        $this->apiToken = $apiToken;
52 1
    }
53
54
    /**
55
     * @return string
56
     */
57 1
    public function getApiKey()
58
    {
59 1
        return $this->apiKey;
60
    }
61
62
    /**
63
     * @return string
64
     */
65 1
    public function getApiToken()
66
    {
67 1
        return $this->apiToken;
68
    }
69
70
    /**
71
     * Set Client and authenticate.
72
     */
73 2
    public function setClient()
74
    {
75 2
        $this->client = new Client();
76 2
        $this->client->authenticate($this->apiKey, $this->apiToken, Client::AUTH_URL_CLIENT_ID);
77 2
    }
78
79
    /**
80
     * @return Client
81
     */
82 1
    public function getClient()
83
    {
84 1
        return $this->client;
85
    }
86
}
87