/** * @inheritdoc */ public function __construct($name = null, array $data = [], $dataName = '') { parent::__construct($name, $data, $dataName); // Set debugger options Debugger::$documentRoot = 'E:\\GitHub\\'; Debugger::$showCalledFrom = false; Debugger::$output = false; }
function foo() { Debugger::showTrace(); }
<?php ini_set('error_reporting', E_ALL | E_STRICT); ini_set('display_errors', 1); ini_set('html_errors', 1); ini_set('log_errors', 0); require_once '../src/autoload.php'; use Xicrow\PhpDebug\Debugger; use Xicrow\PhpDebug\Timer; Debugger::$documentRoot = 'E:\\GitHub\\'; Debugger::$showCalledFrom = true; Timer::$forceDisplayUnit = 'MS'; Timer::$colorThreshold = [0 => 'green', 5000 => 'orange', 50000 => 'red']; ?> <html> <head> <meta charset="UTF-8"> <title>Xicrow/Debug/Timer</title> </head> <body> <?php Timer::start('Total'); // No name test Timer::start(); Timer::stop(); // Loop test for ($i = 1; $i <= 2; $i++) { Timer::start('Loop level 1'); for ($j = 1; $j <= 2; $j++) { Timer::start('Loop level 2');
/** * @test * @covers \Xicrow\PhpDebug\Debugger::reflectClassMethod */ public function testReflectClassMethod() { $result = Debugger::reflectClassMethod('DebuggerTestClass', 'publicFunction'); $this->assertContains('public function publicFunction($param1, $param2 = NULL, $param3 = TRUE, $param4 = 4, $param5 = "5", $param6 = [])', $result); }