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
Pull Request — master (#31)
by
unknown
14:46
created

Vindi::isSandbox()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 0
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
3
namespace Vindi;
4
5
class Vindi
6
{   
0 ignored issues
show
Coding Style introduced by
The opening class brace should be on a newline by itself.
Loading history...
7
    /**
8
     * This Package SDK Version.
9
     * @var string
10
     */
11
    public static $sdkVersion = '1.0.10';    
12
13
    /**
14
     * The Environment variable name for API Key.
15
     * @var string
16
     */
17
    public static $apiKeyEnvVar = 'VINDI_API_KEY';
18
    
19
    /**
20
     * Status of your application vindi
21
     * @var string
22
     */
23
    public static $appEnv = 'VINDI_APP_ENV';
24
25
    /**
26
     * Get Vindi API Key from environment.
27
     * @return string
28
     */
29 430
    public function getApiKey()
30
    {
31 430
        return getenv(static::$apiKeyEnvVar);
32
    }
33
34
    public function isSandbox()
35
    {
36
        return getenv(static::$appEnv);
37
    }
38 430
39
    /**
40 430
     * Get CA Bundle Path.
41
     * @return string
42
     */
43
    public function getCertPath()
44
    {
45
        return realpath(sprintf('%s/%s', dirname(__FILE__), '/../data/ssl/ca-bundle.crt'));
46
    }
47
48
    /**
49
     * Get url base with reference of application
50
     *
51
     * @return string
52
     */
53
    public function getApiBase()
54
    {
55
        if ($this->isSandbox()) return 'https://sandbox-app.vindi.com.br/api/v1/';
56
        return 'https://app.vindi.com.br/api/v1/';
57
    }
58
}
59