11<?php
22/**
3- * VarDumper Functions - used in your code:
3+ * Kint and VarDumper Functions.
4+ *
5+ * VarDumper functions:
46 * vdump()
57 * vd()
68 * vdd()
79 * vddd()
810 *
9- * Note: The `v` prefix separates it from the Kint version.
11+ * Note: The `v` prefix separates it from the Kint version.
12+ *
13+ * Kint functions:
14+ * dd()
15+ * ddd()
1016 *
1117 * @package KnowTheCode\DebugToolkit
1218 * @since 1.0.0
2329
2430if ( ! function_exists ( 'vdump ' ) ) {
2531 /**
26- * Dumps the given variable(s).
32+ * VarDumper: Dumps the given variable(s).
2733 *
2834 * @since 1.0.0
2935 *
@@ -36,14 +42,35 @@ function vdump( $var ) {
3642
3743if ( ! function_exists ( 'vd ' ) ) {
3844 /**
39- * Dumps the given variable(s) .
45+ * VarDumper: Dumps the given variable.
4046 *
4147 * @since 1.0.0
4248 *
4349 * @param mixed $var Variable to dump.
4450 */
4551 function vd ( $ var ) {
46- VarDumper_Helpers::dump ( $ var , __FUNCTION__ );
52+ VarDumper_Helpers::dump ( $ var );
53+ }
54+ }
55+
56+ if ( ! function_exists ( 'dd ' ) ) {
57+ /**
58+ * Kint: Dumps the given variable(s) and then ends the execution of the program.
59+ *
60+ * @since 1.0.0
61+ *
62+ * @param mixed $var Variable to dump.
63+ */
64+ function dd ( $ var ) {
65+ $ vars = func_get_args ();
66+
67+ if ( count ( $ vars ) > 1 ) {
68+ call_user_func_array ( [ Kint::class, 'dump ' ], $ vars );
69+ } else {
70+ Kint::dump ( $ var );
71+ }
72+
73+ die ();
4774 }
4875}
4976
@@ -60,9 +87,30 @@ function vdd( $var ) {
6087 }
6188}
6289
90+ if ( ! function_exists ( 'ddd ' ) ) {
91+ /**
92+ * Kint: Dumps the given variable and then ends the execution of the program.
93+ *
94+ * @since 1.0.0
95+ *
96+ * @param mixed $var Variable to dump.
97+ */
98+ function ddd ( $ var ) {
99+ $ vars = func_get_args ();
100+
101+ if ( count ( $ vars ) > 1 ) {
102+ call_user_func_array ( [ Kint::class, 'dump ' ], $ vars );
103+ } else {
104+ Kint::dump ( $ var );
105+ }
106+
107+ die ();
108+ }
109+ }
110+
63111if ( ! function_exists ( 'vddd ' ) ) {
64112 /**
65- * Dumps the given variable(s) and then ends the execution of the program.
113+ * VarDumper: Dumps the given variable and then ends the execution of the program.
66114 *
67115 * @since 1.0.0
68116 *
0 commit comments