From f136f8da117c9b311f762074aef96ba8edf71b68 Mon Sep 17 00:00:00 2001 From: Erik van der Bas Date: Wed, 2 Oct 2024 22:15:35 +0200 Subject: [PATCH] fix: Fix for function generator not working because class is not defined --- lib/Compiler/Method/Method.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/Compiler/Method/Method.php b/lib/Compiler/Method/Method.php index 68fd3b1..a1f5d19 100644 --- a/lib/Compiler/Method/Method.php +++ b/lib/Compiler/Method/Method.php @@ -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());