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.

Client::getDefaultOptions()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 13
ccs 0
cts 2
cp 0
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 10
nc 1
nop 0
crap 2
1
<?php
2
3
/*
4
 * This file is part of gpupo/cnova-sdk
5
 * Created by Gilmar Pupo <[email protected]>
6
 * For the information of copyright and license you should read the file
7
 * LICENSE which is distributed with this source code.
8
 * Para a informação dos direitos autorais e de licença você deve ler o arquivo
9
 * LICENSE que é distribuído com este código-fonte.
10
 * Para obtener la información de los derechos de autor y la licencia debe leer
11
 * el archivo LICENSE que se distribuye con el código fuente.
12
 * For more information, see <https://opensource.gpupo.com/>.
13
 */
14
15
namespace Gpupo\CnovaSdk\Client;
16
17
use Gpupo\CommonSdk\Client\ClientAbstract;
18
use Gpupo\CommonSdk\Client\ClientInterface;
19
20
class Client extends ClientAbstract implements ClientInterface
21
{
22
    public function getDefaultOptions()
23
    {
24
        return [
25
            'client_id'     => false,
26
            'access_token'  => false,
27
            'base_url'      => 'https://{VERSION}.cnova.com/api/v2',
28
            'version'       => 'sandbox',
29
            'verbose'       => false,
30
            'sslVersion'    => 'SecureTransport',
31
            'cacheTTL'      => 3600,
32
            'sslVerifyPeer' => true,
33
        ];
34
    }
35
36
    protected function renderAuthorization()
37
    {
38
        $list = [];
39
40
        foreach (['client_id', 'access_token'] as $key) {
41
            $value = $this->getOptions()->get($key);
42
            if (empty($value)) {
43
                throw new \InvalidArgumentException('['.$key.'] ausente!');
44
            }
45
46
            $list[] = $key.':'.$value;
47
        }
48
49
        return $list;
50
    }
51
}
52