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.

Cli::send()   A
last analyzed

Complexity

Conditions 4
Paths 6

Size

Total Lines 31
Code Lines 22

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 4
eloc 22
c 1
b 0
f 0
nc 6
nop 0
dl 0
loc 31
rs 9.568
1
<?php
2
/**
3
 * This file is part of the O2System Framework package.
4
 *
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 *
8
 * @author         Steeve Andrian Salim
9
 * @copyright      Copyright (c) Steeve Andrian Salim
10
 */
11
12
// ------------------------------------------------------------------------
13
14
namespace O2System\Gear;
15
16
// ------------------------------------------------------------------------
17
18
/**
19
 * Class Cli
20
 *
21
 * @package O2System\Gear
22
 */
23
class Cli
24
{
25
    /**
26
     * Cli::$expression
27
     *
28
     * @var mixed
29
     */
30
    private $expression;
31
32
    // ------------------------------------------------------------------------
33
34
    /**
35
     * Cli::__construct
36
     *
37
     * @param mixed $expression
38
     */
39
    public function __construct($expression)
40
    {
41
        $this->expression = var_format($expression);
42
    }
43
44
    // ------------------------------------------------------------------------
45
46
    /**
47
     * Cli::send
48
     */
49
    public function send()
50
    {
51
        $trace = new \O2System\Gear\Trace();
52
53
        echo chr(27) . chr(91) . 'H' . chr(27) . chr(91) . 'J';
54
        echo PHP_EOL . 'START of gears:print_cli' . PHP_EOL;
55
        echo "--------------------------------------------------------------------------------------" . PHP_EOL . PHP_EOL;
56
        if ( ! is_string($this->expression)) {
57
            $this->expression = print_r($this->expression, true);
58
        }
59
        echo $this->expression . PHP_EOL;
60
        echo PHP_EOL . '--------------------------------------------------------------------------------------' . PHP_EOL . PHP_EOL;
61
62
        echo 'DEBUG BACKTRACE' . PHP_EOL;
63
        echo '--------------------------------------------------------------------------------------' . PHP_EOL . PHP_EOL;
64
        $i = 1;
65
        foreach ($trace->getChronology() as $chronology) {
66
            echo $i . '. Method: ' . $chronology->call . PHP_EOL;
67
            echo str_repeat(
68
                    ' ',
69
                    strlen($i)
70
                ) . '  Line: ' . $chronology->file . ':' . $chronology->line . PHP_EOL . PHP_EOL;
71
            $i++;
72
73
            if ($chronology->call === 'print_cli()') {
74
                break;
75
            }
76
        }
77
78
        echo PHP_EOL . "-------------------------------------------------------------------------------------- " . PHP_EOL;
79
        echo 'END of gears:print_cli' . PHP_EOL . PHP_EOL;
80
    }
81
}