Skip to content

Commit 09a1603

Browse files
authored
fix: Fix for function generator not working because class is not defined (#16)
1 parent 0a4d890 commit 09a1603

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/Compiler/Method/Method.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,14 @@ public function compile()
8989
// Return Tag
9090
$contents .= (new Return_($this->method))->compile();
9191

92-
if (!empty($this->class->getParentMethods())
92+
if (
93+
$this->class && !empty($this->class->getParentMethods())
9394
&& in_array($this->method->reflection->getFqsen()->__toString(), array_keys($this->class->getParentMethods()))
94-
) {
95+
) {
9596
$contents .= self::NEWLINE;
9697
$contents .= '*This method is inherited from `' . $this->class->getParent() . '`.*';
9798
$contents .= self::PARAGRAPH;
98-
}
99+
}
99100

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

0 commit comments

Comments
 (0)