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.
Completed
Push — 1.x ( f2247a...73fe3f )
by Jakub
04:00
created

ApiBase   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 51
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 1
dl 0
loc 51
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getSubscriptionKey() 0 7 2
A setSubscriptionKey() 0 5 1
1
<?php
2
3
namespace zaporylie\Vipps\Api;
4
5
use zaporylie\Vipps\Exceptions\Api\InvalidArgumentException;
6
use zaporylie\Vipps\Resource\ResourceInterface;
7
use zaporylie\Vipps\VippsInterface;
8
9
abstract class ApiBase
10
{
11
12
    /**
13
     * @var \zaporylie\Vipps\VippsInterface
14
     */
15
    protected $app;
16
17
    /**
18
     * @var string
19
     */
20
    protected $subscriptionKey;
21
22
    /**
23
     * ApiBase constructor.
24
     *
25
     * @param \zaporylie\Vipps\VippsInterface $app
26
     * @param string $subscription_key
27
     */
28
    public function __construct(VippsInterface $app, $subscription_key)
29
    {
30
        $this->app = $app;
31
        $this->subscriptionKey = $subscription_key;
32
    }
33
34
    /**
35
     * Gets subscription_key value.
36
     *
37
     * @return string
38
     */
39
    public function getSubscriptionKey()
40
    {
41
        if (empty($this->subscriptionKey)) {
42
            throw new InvalidArgumentException('Missing subscription key');
43
        }
44
        return $this->subscriptionKey;
45
    }
46
47
    /**
48
     * Sets subscription_key variable.
49
     *
50
     * @param string $subscriptionKey
51
     *
52
     * @return $this
53
     */
54
    public function setSubscriptionKey($subscriptionKey)
55
    {
56
        $this->subscriptionKey = $subscriptionKey;
57
        return $this;
58
    }
59
}
60