Skip to content

Commit

Permalink
Add object name in prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
ThibaudDauce committed Jul 2, 2021
1 parent 019ba6a commit a9728f8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Backtrace.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ public function getFunctionName(): string
return $this->trace['function'];
}

public function getObjectName(): ?string
{
return $this->trace['class'] ?? null;
}

public function getObject(): mixed
{
if ($this->globalFunction()) {
Expand All @@ -40,7 +45,7 @@ public function getHash(): string
return is_object($argument) ? spl_object_hash($argument) : $argument;
}, $this->getArguments());

$prefix = $this->getFunctionName();
$prefix = $this->getObjectName() . $this->getFunctionName();
if (str_contains($prefix, '{closure}')) {
$prefix = $this->zeroStack['line'];
}
Expand Down

0 comments on commit a9728f8

Please sign in to comment.