Skip to content

Commit

Permalink
Fallback to the parent's classname if the parent has no name, for the…
Browse files Browse the repository at this point in the history
… "child of ..." comment
  • Loading branch information
Numynum committed Oct 30, 2024
1 parent e2c4692 commit 74d6ed0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/XmlFileParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ private function writeFrame(Frame $frame, ?string $linkPrefix, ?string $typeOver
$data .= "--- [Source]($linkPrefix#L" . $frame->getLineNumber() . ")\n";
}
if ($frame->getParent()) {
$data .= '--- child of ' . $frame->getParent()->getName();
$data .= '--- child of ' . ($frame->getParent()->getName() ?: $frame->getParent()->getClassName());
if ($frame->getOriginalParent() && $frame->getOriginalParent() !== $frame->getParent()) {
$data .= ' (created in template ' . $frame->getOriginalParent()->getName() . ')';
}
Expand Down

0 comments on commit 74d6ed0

Please sign in to comment.