Utils to debug the code while writing it.

author Emanuele 'Tex' Tessore
package classes

 Methods

Prints the dump for the given $var

debug(mixed $var) 

Parameters

$var

mixed

the variable to be dumped

Debug the assets list on the bottom of the page

debug_assets() 

Enables debugging of deprecated functions

debug_deprecated() 

Dumps the $wp_scripts global variable

dump_assets() 

Dumps the stack trace when a deprecated function is encountered

dump_deprecated(string $function, string $message, string $version) 
todo : need improvements on readability

Parameters

$function

string

function name

$message

string

deprecation message

$version

string

first version with deprecated entry

This object is a Singleton.

get_instance() : \DebugUtils
Static

This method gets the instance of it.

Returns

\DebugUtilsthe single instance of the class

Retrieves the current level of echo

get_level() : \the

Returns

\thecurrent level of echo

Sets the level of output.

set_level(int $level) : \DebugUtils

Use DebugUtils::SOFT DebugUtils::H1_PRE or DebugUtils::H1_PRE_DIE

Parameters

$level

int

the level

Returns

\DebugUtilsfor chaining

Sets the title of the box

set_title(string $title) : \DebugUtils

Parameters

$title

string

Returns

\DebugUtilsfor chaining

Initializes the default settings

__construct() 

 Properties

 

$status : boolean
 

the template for the debug section

$tpl : \SubstitutionTemplate
 

singleton instance

$instance : \DebugUtils
 

the level of debug: html comments, h1 and pre, h1 pre and die.

$level : int
 

the title to be printed on top of the variable dump

$title : string

 Constants

 

Wrap the var_dump into an html comment

COMMENT 
 

Print a well visible H1 and the dump is wrapped in a pre

H1_PRE 
 

Print a well visible H1, use a pre as wrapper for the variable dump and then stop the execution of the script

H1_PRE_DIE