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.

ApiBase::getSubscriptionKey()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

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