Skip to content

Commit b58fe61

Browse files
Updated readme.txt
1 parent cdcfccb commit b58fe61

File tree

3 files changed

+46
-8
lines changed

3 files changed

+46
-8
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ It renders as:
125125

126126
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?
127127

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

130130
Consider the error this code would produce:
131131

readme.txt

+43-5
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,57 @@ Code debug made easier and more enjoyable.
1212

1313
== Description ==
1414

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

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

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

20-
* `d( $var );` to render a collapsible UI container which displays your variable data in "the most informative way"
21-
* `ddd( $var );` same as d() except that it also executes `die()` to halt execution.
24+
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?
2225

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

28+
* Provides the error message and links to search Google, DuckDuckGo, and Stack Overflow.
29+
* Shows the actual code where the error occurred.
30+
* Provides an interactive call stack. Click each and the actual code appears in the viewer panel.
31+
* Environment and details including GET Data, POST Data, Files, Cookie, Session, Server/Request Data, Environment Variables, and Registered Handlers.
32+
33+
== Handy Tools for Exploring Variable Values ==
34+
35+
This plugin provides two different tools for exploring the value in a variable:
36+
37+
* VarDumper from Symfony
38+
* Kint
39+
40+
VarDumper provides a simple container that displays where you place it.
41+
42+
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.
43+
44+
= Which one should you use? =
45+
46+
It depends.
47+
48+
1. You want to simply display the contents of a variable: Use VarDumper's functions, i.e. `vdump()`, `vd()`, `vdd()`, or `vddd()`.
49+
2. You want the call stack in addition to the variable: Use Kint's functions: `d()`, `dd()`, or `ddd()`.
50+
51+
= Functions =
52+
53+
| Task | VarDumper | Kint |
54+
| :--- | :--- | :--- |
55+
| Dumps the given variable(s) | `vd( mixed $var );` | `d( mixed $var [ , mixed $var2, ...] );` |
56+
| Dumps the given variable(s) | `vdump( mixed $var );` | `Kint::dump( mixed $var [ , mixed $var2, ...] );` |
57+
| Dumps and dies | `vdd( mixed $var );` | `dd( mixed $var [ , mixed $var2, ...] );` |
58+
| Dumps and dies | `vddd( mixed $var );` | `ddd( mixed $var [ , mixed $var2, ...] );` |
59+
| Dumps and dies | `vddd( mixed $var );` | `ddd( mixed $var [ , mixed $var2, ...] );` |
60+
| Dumps plain text | na | `s( mixed $var [ , mixed $var2, ...] );` |
61+
| Dumps debug trace | na | `Kint::trace();` |
2462

2563
== Admin Bar ==
2664

27-
"KINT ACTIVE" indicator displays in the WordPress admin bar to alert you when the plugin is active.
65+
"DEBUG ACTIVE" indicator displays in the WordPress admin bar to alert you when the plugin is active.
2866

2967
== Installation ==
3068

src/functions.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ function vd( $var ) {
5555

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

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

9696
/**
9797
* Kint: Dumps the given variable and then ends the execution of the program.

0 commit comments

Comments
 (0)