Debugger base class.

category phpDocumentor
package Core
author Mike van Riel
license MIT
link http://phpdoc.org

 Methods

Initializes this object.

__construct(\phpDocumentor_Core_Log $logger) 

Parameters

$logger

\phpDocumentor_Core_Log

A logger used to output debug messages.

Returns the time that has elapsed since the last reset of the timer.

getElapsedTime(string $name) : float

Parameters

$name

string

Name of the used timer.

Returns

float

Logs the given to a debug log.

log(string | array | object $message) : void

If anything other than a string is passed than the item is var_dumped and then stored.

Parameters

$message

stringarrayobject

Item to log.

Logs a debug message post-fixed with timer information.

logWithTimeElapsed(string $message, string $name) : void

The string which is sent to the debug logger looks like:

$message in {time} seconds.

Thus for readability is advised to write messages as the following examples:

  • 'Processed parameters' (in 4 seconds)
  • 'Written to log' (in 4 seconds)

Parameters

$message

string

Text to prefix the default message with.

$name

string

Name of the timer to use.

Resets a timer (with the given name) to the current time.

resetTimer(string $name) : void

Parameters

$name

string

Name of the used timer.

 Properties

 

$logger

$logger : \phpDocumentor_Core_Log

 

Associative array containing all timers by name.

$timer : \float[]