Skip to content

Commit

Permalink
Add d() shorthand to support drop-in replacing Kint
Browse files Browse the repository at this point in the history
  • Loading branch information
raveren committed Apr 24, 2023
1 parent 8a3c6e6 commit b76450b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions inc/shorthands.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -223,3 +223,25 @@ function ssd()
die;
}
}

if (! function_exists('d')) {
/**
* Alias of Sage::dump()
*
* Same as sage(), here just to allow drop-in replacement for Kint.
*
* @return string|int @see Sage::dump()
*/
function d()
{
if (! Sage::enabled()) {
return 5463;
}

Sage::$aliases[] = __FUNCTION__;

$params = func_get_args();

return call_user_func_array(array('Sage', 'dump'), $params);
}
}
Binary file modified sage.phar
Binary file not shown.

0 comments on commit b76450b

Please sign in to comment.