Skip to content

Commit

Permalink
revert args: remove $showFrom for dd()
Browse files Browse the repository at this point in the history
  • Loading branch information
tenkoma committed Feb 25, 2017
1 parent 5ca71bc commit 4d1d6dc
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions src/basics.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,24 +121,20 @@ function breakpoint()
*
* @param mixed $var Variable to show debug information for.
* @param bool|null $showHtml If set to true, the method prints the debug data in a browser-friendly way.
* @param bool $showFrom If set to true, the method prints from where the function was called.
* @return void
* @link http://book.cakephp.org/3.0/en/development/debugging.html#basic-debugging
*/
function dd($var, $showHtml = null, $showFrom = true)
function dd($var, $showHtml = null)
{
if (!Configure::read('debug')) {
return;
}

$location = [];
if ($showFrom) {
$trace = Debugger::trace(['start' => 1, 'depth' => 2, 'format' => 'array']);
$location = [
'line' => $trace[0]['line'],
'file' => $trace[0]['file']
];
}
$trace = Debugger::trace(['start' => 1, 'depth' => 2, 'format' => 'array']);
$location = [
'line' => $trace[0]['line'],
'file' => $trace[0]['file']
];

Debugger::printVar($var, $location, $showHtml);
die(1);
Expand Down

0 comments on commit 4d1d6dc

Please sign in to comment.