Completed
Push — master ( 4a9127...2f6da3 )
by Jacob
02:18
created

Display::setConsoleData()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
/*****************************************
4
 * Title : Php Quick Profiler Display Class
5
 * Author : Created by Ryan Campbell
6
 * URL : http://particletree.com/features/php-quick-profiler/
7
 * Description : This is a hacky way of pushing profiling logic to the
8
 *  PQP HTML. This is great because it will just work in your project,
9
 *  but it is hard to maintain and read.
10
*****************************************/
11
12
namespace Particletree\Pqp;
13
14
class Display
15
{
16
17
    /** @var  array */
18
    protected $output;
19
20
    public function __construct()
21
    {
22
    }
23
24
    public function setConsoleData(array $console_data)
25
    {
26
        $this->output['console'] = $console_data;
27
    }
28
29
    public function setFileData(array $file_data)
30
    {
31
        $this->output['files'] = $file_data['files'];
32
        $this->output['fileTotals'] = $file_data['fileTotals'];
33
    }
34
35
    public function setMemoryData(array $memory_data)
36
    {
37
        $this->output['memoryTotals'] = $memory_data;
38
    }
39
40
    public function setQueryData(array $query_data)
0 ignored issues
show
Unused Code introduced by
The parameter $query_data is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
41
    {
42
        // the void
43
    }
44
45
    public function setSpeedData(array $speed_data)
46
    {
47
        $this->output['speedTotals'] = $speed_data;
48
    }
49
50
    public function __invoke()
51
    {
52
        $output = $this->output;
0 ignored issues
show
Unused Code introduced by
$output is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
53
        require_once __DIR__ .'/../asset/display.tpl.php';
54
    }
55
}	
56