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   A
last analyzed

Complexity

Total Complexity 12

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 12
lcom 2
cbo 0
dl 0
loc 32
ccs 16
cts 16
cp 1
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
C __construct() 0 11 9
A userAgent() 0 3 1
A hasAccessToken() 0 3 1
A baseUri() 0 3 1
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
}