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.

Configuration::__construct()   C
last analyzed

Complexity

Conditions 9
Paths 256

Size

Total Lines 11

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 10
CRAP Score 9

Importance

Changes 0
Metric Value
dl 0
loc 11
ccs 10
cts 10
cp 1
rs 6.5222
c 0
b 0
f 0
cc 9
nc 256
nop 1
crap 9
1
<?php
2
3
namespace BoletoSimples;
4
5
class Configuration {
6
  private $environments_uri = array('sandbox' => 'https://sandbox.boletosimples.com.br/api/v1/', 'production' => 'https://boletosimples.com.br/api/v1/');
7
  public $environment = null;
8
  public $application_id = null;
9
  public $application_secret = null;
10
  public $access_token = null;
11
12 29
  public function __construct($params = array()) {
13 29
    $default_environment = getenv('BOLETOSIMPLES_ENV') ? getenv('BOLETOSIMPLES_ENV') : 'sandbox';
14 29
    $default_application_id = getenv('BOLETOSIMPLES_APP_ID') ? getenv('BOLETOSIMPLES_APP_ID') : null;
15 29
    $default_application_secret = getenv('BOLETOSIMPLES_APP_SECRET') ? getenv('BOLETOSIMPLES_APP_SECRET') : null;
16 29
    $default_access_token = getenv('BOLETOSIMPLES_ACCESS_TOKEN') ? getenv('BOLETOSIMPLES_ACCESS_TOKEN') : null;
17
18 29
    $this->environment = isset($params['environment']) ? $params['environment'] : $default_environment;
19 29
    $this->application_id = isset($params['application_id']) ? $params['application_id'] : $default_application_id;
20 29
    $this->application_secret = isset($params['application_secret']) ? $params['application_secret'] : $default_application_secret;
21 29
    $this->access_token = isset($params['access_token']) ? $params['access_token'] : $default_access_token;
22 29
  }
23
24 30
  public function userAgent() {
25 30
    return "BoletoSimples PHP Client v".\BoletoSimples::VERSION." ([email protected])";
26
  }
27
28 3
  public function hasAccessToken() {
29 3
    return $this->access_token != null;
30
  }
31
32 32
  public function baseUri() {
33 32
    return $this->environments_uri[$this->environment];
34
  }
35
36
}