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::setSubscriptionKey()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 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