Completed
Pull Request — master (#12)
by Tobias
05:07
created

AddonAPI::createAddonLink()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 1
dl 0
loc 6
ccs 4
cts 4
cp 1
crap 1
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace SolutionDrive\HipchatAPIv2Client\API;
4
5
use SolutionDrive\HipchatAPIv2Client\ClientInterface;
6
use SolutionDrive\HipchatAPIv2Client\Model\AddonInterface;
7
8
class AddonAPI implements AddonAPIInterface
9
{
10
    /** @var ClientInterface */
11
    private $client;
12
13 2
    public function __construct(
14
        ClientInterface $client
15
    ) {
16 2
        $this->client = $client;
17 2
    }
18
19
    /**
20
     * @inheritdoc
21
     */
22 1
    public function createAddonLink(
23
        AddonInterface $addon
24
    ) {
25 1
        $request = $addon->toJson();
26 1
        $response = $this->client->post('/v2/addon/link', $request);
27 1
        return $response['token'];
28
    }
29
}
30