Skip to content

Commit

Permalink
Updated readme.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
hellofromtonya committed Mar 8, 2019
1 parent cdcfccb commit b58fe61
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ It renders as:

The built-in PHP error container is basic and not as helpful as it could be. On top of that, it's rather ugly. Wouldn't you agree?

The Whoops package gives you a cool interface that is helpful, interactive, and quite nice to look at .
The Whoops package gives you a cool interface that is helpful, interactive, and quite nice to look at.

Consider the error this code would produce:

Expand Down
48 changes: 43 additions & 5 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,57 @@ Code debug made easier and more enjoyable.

== Description ==

Code debug made easier and more enjoyable. This WordPress plugin includes a suite of developer essential tools to debug your code:

= Handy Tools =
* [Whoops - the "PHP errors for cool kids"](http://filp.github.io/whoops/)
* [VarDumper from Symfony](https://symfony.com/doc/current/components/var_dumper.html)
* [Kint - a modern and powerful PHP debugging helper](https://kint-php.github.io/kint/)
* "DEBUG ACTIVE" indicator in the WordPress admin bar to let you know the plugin is activated.

Some handy tools just for the PHP Developer:
== Whoops - An Awesome PHP Error Tool ==

* `d( $var );` to render a collapsible UI container which displays your variable data in "the most informative way"
* `ddd( $var );` same as d() except that it also executes `die()` to halt execution.
The built-in PHP error container is basic and not as helpful as it could be. On top of that, it's rather ugly. Wouldn't you agree?

Whoops gives you a cool interface that is helpful, interactive, and quite nice to look at. Some features:

* Provides the error message and links to search Google, DuckDuckGo, and Stack Overflow.
* Shows the actual code where the error occurred.
* Provides an interactive call stack. Click each and the actual code appears in the viewer panel.
* Environment and details including GET Data, POST Data, Files, Cookie, Session, Server/Request Data, Environment Variables, and Registered Handlers.

== Handy Tools for Exploring Variable Values ==

This plugin provides two different tools for exploring the value in a variable:

* VarDumper from Symfony
* Kint

VarDumper provides a simple container that displays where you place it.

Kint gathers all the data and displayed it at the bottom of the screen as a fixed position container. It also provides a call stack, which can be handy, and tracing functionality if you need it.

= Which one should you use? =

It depends.

1. You want to simply display the contents of a variable: Use VarDumper's functions, i.e. `vdump()`, `vd()`, `vdd()`, or `vddd()`.
2. You want the call stack in addition to the variable: Use Kint's functions: `d()`, `dd()`, or `ddd()`.

= Functions =

| Task | VarDumper | Kint |
| :--- | :--- | :--- |
| Dumps the given variable(s) | `vd( mixed $var );` | `d( mixed $var [ , mixed $var2, ...] );` |
| Dumps the given variable(s) | `vdump( mixed $var );` | `Kint::dump( mixed $var [ , mixed $var2, ...] );` |
| Dumps and dies | `vdd( mixed $var );` | `dd( mixed $var [ , mixed $var2, ...] );` |
| Dumps and dies | `vddd( mixed $var );` | `ddd( mixed $var [ , mixed $var2, ...] );` |
| Dumps and dies | `vddd( mixed $var );` | `ddd( mixed $var [ , mixed $var2, ...] );` |
| Dumps plain text | na | `s( mixed $var [ , mixed $var2, ...] );` |
| Dumps debug trace | na | `Kint::trace();` |

== Admin Bar ==

"KINT ACTIVE" indicator displays in the WordPress admin bar to alert you when the plugin is active.
"DEBUG ACTIVE" indicator displays in the WordPress admin bar to alert you when the plugin is active.

== Installation ==

Expand Down
4 changes: 2 additions & 2 deletions src/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function vd( $var ) {

if ( ! function_exists( 'dd' ) ) {
// Add dd() to Kint.
Kint::$aliases[] = 'dd';
Kint::$aliases[] = 'dd'; // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound
/**
* Kint: Dumps the given variable(s) and then ends the execution of the program.
*
Expand Down Expand Up @@ -91,7 +91,7 @@ function vdd( $var ) {

if ( ! function_exists( 'ddd' ) ) {
// Add ddd() to Kint.
Kint::$aliases[] = 'ddd';
Kint::$aliases[] = 'ddd'; // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound

/**
* Kint: Dumps the given variable and then ends the execution of the program.
Expand Down

0 comments on commit b58fe61

Please sign in to comment.