Skip to content

Commit b76450b

Browse files
committed
Add d() shorthand to support drop-in replacing Kint
1 parent 8a3c6e6 commit b76450b

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

inc/shorthands.inc.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,3 +223,25 @@ function ssd()
223223
die;
224224
}
225225
}
226+
227+
if (! function_exists('d')) {
228+
/**
229+
* Alias of Sage::dump()
230+
*
231+
* Same as sage(), here just to allow drop-in replacement for Kint.
232+
*
233+
* @return string|int @see Sage::dump()
234+
*/
235+
function d()
236+
{
237+
if (! Sage::enabled()) {
238+
return 5463;
239+
}
240+
241+
Sage::$aliases[] = __FUNCTION__;
242+
243+
$params = func_get_args();
244+
245+
return call_user_func_array(array('Sage', 'dump'), $params);
246+
}
247+
}

sage.phar

452 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)