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
Push — master ( 951ad1...29ba67 )
by Alexey
08:55
created

GlobalConfig   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 68
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 40%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 7
c 1
b 0
f 0
lcom 1
cbo 0
dl 0
loc 68
ccs 10
cts 25
cp 0.4
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 16 2
A __get() 0 15 3
A instance() 0 7 2
1
<?php
0 ignored issues
show
Coding Style Compatibility introduced by
For compatibility and reusability of your code, PSR1 recommends that a file should introduce either new symbols (like classes, functions, etc.) or have side-effects (like outputting something, or including other files), but not both at the same time. The first symbol is defined on line 19 and the first side effect is on line 88.

The PSR-1: Basic Coding Standard recommends that a file should either introduce new symbols, that is classes, functions, constants or similar, or have side effects. Side effects are anything that executes logic, like for example printing output, changing ini settings or writing to a file.

The idea behind this recommendation is that merely auto-loading a class should not change the state of an application. It also promotes a cleaner style of programming and makes your code less prone to errors, because the logic is not spread out all over the place.

To learn more about the PSR-1, please see the PHP-FIG site on the PSR-1.

Loading history...
2
/**
3
 * @author Alexey Tatarinov <[email protected]>
4
 * @link https://github.com/shogodev/argilla/
5
 * @copyright Copyright &copy; 2003-2016 Shogo
6
 * @license http://argilla.ru/LICENSE
7
 */
8
/**
9
 * Class GlobalConfig
10
 *
11
 * @property string $rootPath
12
 * @property string $frameworkPath
13
 * @property string $backendPath
14
 * @property string $frontendPath
15
 * @property string $frontendConfigPath
16
 * @property string $backendConfigPath
17
 * @property string $frameworkVersion
18
 */
19
class GlobalConfig
20
{
21
  protected $rootPath;
22
23
  protected $frameworkPath;
24
25
  protected $frontendPath;
26
27
  protected $frontendConfigPath;
28
29
  protected $backendPath;
30
31
  protected $backendConfigPath;
32
33
  /**
34
   * @var GlobalConfig $instance
35
   */
36
  protected static $instance;
37
38
  /**
39
   * @var string $frameworkVersion требуемая версия фреймворка
40
   */
41
  protected $frameworkVersion;
42
43
  public function __construct()
44
  {
45
    $this->rootPath = realpath(__DIR__.'/../../');
46
    $this->frontendPath = $this->rootPath.'/protected';
47
    $this->frontendConfigPath = $this->rootPath.'/protected/config';
48
    $frameworkConfig = require_once $this->frontendConfigPath.'/framework.php';
49
50
    if( !($this->frameworkPath = realpath($this->rootPath.$frameworkConfig['frameworkPath'])) )
51
    {
52
      throw new Exception('Framework path "'.$frameworkConfig['frameworkPath'].'" wasn\'t found');
53
    }
54
55
    $this->frameworkVersion = $frameworkConfig['version'];
56
    $this->backendPath = $this->rootPath.'/backend/protected';
57
    $this->backendConfigPath = $this->rootPath.'/backend/protected/config';
58
  }
59
60 33
  public function __get($name)
61
  {
62 33
    $getter = 'get'.$name;
63
64 33
    if( method_exists($this, $getter) )
65 33
    {
66
      return $this->$getter();
67
    }
68 33
    else if( property_exists($this, $name) )
69 33
    {
70 33
      return $this->$name;
71
    }
72
73
    throw new Exception('Property "'.get_class($this).'.'.$name.'" is not defined.');
74
  }
75
76
  /**
77
   * @return GlobalConfig
78
   */
79 33
  public static function instance()
80
  {
81 33
    if( isset(self::$instance) )
82 33
      return self::$instance;
83
84
    return self::$instance = new self;
85
  }
86
}
87
88
mb_internal_encoding("UTF-8");
89
mb_http_output("UTF-8" );
90
$globalConfig = GlobalConfig::instance();