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.

AbstractClientFactory::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
1
<?php
2
3
namespace Onend\PayPal\Common\Factory\Client;
4
5
use Onend\PayPal\Common\Auth\AccessTokenProviderInterface;
6
use Onend\PayPal\Common\Auth\AuthClient;
7
use Onend\PayPal\Common\Auth\Credentials;
8
use Onend\PayPal\Common\Auth\DefaultAccessTokenProvider;
9
use Onend\PayPal\Common\Enum\ApiBaseUrl;
10
11
abstract class AbstractClientFactory implements ClientFactoryInterface
12
{
13
    /**
14
     * @var \Onend\PayPal\Common\Auth\Credentials
15
     */
16
    protected $credentials;
17
18
    /**
19
     * @var DefaultAccessTokenProvider
20
     */
21
    protected $accessTokenProvider;
22
23
    /**
24
     * @var string
25
     */
26
    protected $baseUrl;
27
28
    /**
29
     * @param Credentials $credentials
30
     * @param string $baseUrl
31
     */
32
    public function __construct(Credentials $credentials, $baseUrl = ApiBaseUrl::SANDBOX)
33
    {
34
        $this->baseUrl = $baseUrl;
35
        $this->credentials = $credentials;
36
        $authClient = new AuthClient($baseUrl);
37
        $authClient->setCredentials($credentials);
38
        $this->accessTokenProvider = new DefaultAccessTokenProvider($authClient);
39
    }
40
41
    /**
42
     * @param AccessTokenProviderInterface $accessTokenProvider
43
     */
44
    public function setAccessTokenProvider(AccessTokenProviderInterface $accessTokenProvider)
45
    {
46
        $this->accessTokenProvider->setProvider($accessTokenProvider);
47
    }
48
}
49