AddonAPI   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 20
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A createAddonLink() 0 6 1
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