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.

Base::beforeRoute()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 5
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace App\CLI;
4
5
use App\{Traits, Controllers, Models, Mappers};
6
7
/**
8
 * Base CLI Controller Class.
9
 *
10
 * @license GPLv3 (http://www.gnu.org/licenses/gpl-3.0.html)
11
 */
12
abstract class Base
13
{
14
    /**
15
     * @var \Log log class
16
     */
17
    protected $logger;
18
19
    /**
20
     * @var \DB\SQL database class
21
     */
22
    protected $db;
23
24
    /**
25
     * Use climate by default
26
     *
27
     * @var object cli-handling class
28
     * @link http://climate.thephpleague.com/
29
     */
30
    protected $cli;
31
32
33
    /**
34
    * init
35
    * @param \Base $f3
36
    */
37
    public function __construct(\Base $f3)
38
    {
39
        if (empty($f3->get('CLI'))) {
40
            exit("This controller can only be executed in CLI mode.");
41
        }
42
43
        $this->db = \Registry::get('db');
44
        $this->logger = \Registry::get('logger');
45
        $this->cli = new \League\CLImate\CLImate;
46
    }
47
48
    /**
49
     * @return void
50
     */
51
    public function beforeRoute()
52
    {
53
        $cli = $this->cli;
54
        $cli->blackBoldUnderline("CLI Script");
55
    }
56
57
58
    /**
59
     * @param \Base $f3
60
     * @return void
61
     */
62
    public function afterRoute($f3)
63
    {
64
        $cli = $this->cli;
65
        $cli->shout('Finished.');
66
        $cli->info('Script executed in ' . round(microtime(true) - $f3->get('TIME'), 3) . ' seconds.');
67
        $cli->info('Memory used ' . round(memory_get_peak_usage() / 1024 / 1024, 2) . ' MB.');
68
    }
69
}
70