for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*****************************************
* Title : Php Quick Profiler Display Class
* Author : Created by Ryan Campbell
* URL : http://particletree.com/features/php-quick-profiler/
* Description : This is a hacky way of pushing profiling logic to the
* PQP HTML. This is great because it will just work in your project,
* but it is hard to maintain and read.
*****************************************/
namespace Particletree\Pqp;
class Display
{
/** @var array */
protected $output;
public function __construct()
}
public function setConsoleData(array $console_data)
$this->output['console'] = $console_data;
public function setFileData(array $file_data)
$this->output['files'] = $file_data['files'];
$this->output['fileTotals'] = $file_data['fileTotals'];
public function setMemoryData(array $memory_data)
$this->output['memoryTotals'] = $memory_data;
public function setQueryData(array $query_data)
$query_data
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.
// the void
public function setSpeedData(array $speed_data)
$this->output['speedTotals'] = $speed_data;
public function __invoke()
$output = $this->output;
$output
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.
$myVar
$higher
require_once __DIR__ .'/../asset/display.tpl.php';
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.