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.

Browser::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
rs 10
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
use O2System\Gear\Profiler\DataStructures\Metric;
19
20
/**
21
 * Class Browser
22
 *
23
 * @package O2System\Gear
24
 */
25
class Browser
26
{
27
    /**
28
     * Browser::$expression
29
     *
30
     * @var mixed
31
     */
32
    private $expression;
33
34
    // ------------------------------------------------------------------------
35
36
    /**
37
     * Browser::__construct
38
     *
39
     * @param mixed $expression
40
     */
41
    public function __construct($expression)
42
    {
43
        $this->expression = var_format($expression);
44
    }
45
46
    // ------------------------------------------------------------------------
47
48
    /**
49
     * Browser::render
50
     *
51
     * @return false|string
52
     */
53
    public function render()
54
    {
55
        $metric = new Metric('print-out');
56
        $metric->start();
57
        ini_set('memory_limit', '512M');
58
59
        if ( ! is_string($this->expression)) {
60
            $this->expression = print_r($this->expression, true);
61
        }
62
63
        $expression = htmlentities($this->expression);
0 ignored issues
show
Unused Code introduced by
The assignment to $expression is dead and can be removed.
Loading history...
64
        $expression = htmlspecialchars(htmlspecialchars_decode($this->expression, ENT_QUOTES), ENT_QUOTES, 'UTF-8');
65
        $trace = new Trace();
66
67
        $metric->stop();
68
69
        ob_start();
70
        include __DIR__ . '/Views/Screen.php';
71
        $output = ob_get_contents();
72
        ob_end_clean();
73
74
        return $output;
75
    }
76
}