Utils to debug the code while writing it.
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
Retrieves the current level of echo
get_level() : \the
Returns
\the
current 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
Returns
Sets the title of the box
set_title(string $title) : \DebugUtils
Parameters
$title
string
Returns
Initializes the default settings
__construct()
Properties
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
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