Skip to content

Commit

Permalink
Merge 6b21c49 into 38628d4
Browse files Browse the repository at this point in the history
  • Loading branch information
sj-i committed Aug 1, 2021
2 parents 38628d4 + 6b21c49 commit 084639f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion resources/templates/phpspy.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
use PhpProfiler\Lib\PhpProcessReader\CallTrace;
/** @var CallTrace $call_trace */
?><?php foreach ($call_trace->call_frames as $depth => $frame): ?>
<?= $depth ?> <?= $frame->getFullyQualifiedFunctionName() ?> <?= $frame->file_name ?>:<?= $frame->opline->lineno, "\n" ?>
<?= $depth ?> <?= $frame->getFullyQualifiedFunctionName() ?> <?= $frame->file_name ?>:<?= $frame->getLineno(), "\n" ?>
<?php endforeach ?>
8 changes: 8 additions & 0 deletions src/Lib/PhpProcessReader/CallFrame.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,12 @@ public function getFullyQualifiedFunctionName(): string
}
return "{$this->class_name}::{$this->function_name}";
}

public function getLineno(): int
{
if (is_null($this->opline)) {
return -1;
}
return $this->opline->lineno;
}
}

0 comments on commit 084639f

Please sign in to comment.