Skip to content

Commit

Permalink
fix: Fix for function generator not working because class is not defi…
Browse files Browse the repository at this point in the history
…ned (#16)
  • Loading branch information
Levdbas authored Oct 7, 2024
1 parent 0a4d890 commit 09a1603
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/Compiler/Method/Method.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,14 @@ public function compile()
// Return Tag
$contents .= (new Return_($this->method))->compile();

if (!empty($this->class->getParentMethods())
if (
$this->class && !empty($this->class->getParentMethods())
&& in_array($this->method->reflection->getFqsen()->__toString(), array_keys($this->class->getParentMethods()))
) {
) {
$contents .= self::NEWLINE;
$contents .= '*This method is inherited from `' . $this->class->getParent() . '`.*';
$contents .= self::PARAGRAPH;
}
}

if ($this->method->hasParameters()) {
$paramsTable = new Table($this->method->getParameters());
Expand Down

0 comments on commit 09a1603

Please sign in to comment.