Skip to content

Commit b162347

Browse files
authored
fix when no enclosingClass can be found (#1239)
In certain situations no enclosingClass can be found, quick fix is to just return then.
1 parent f4e0fc3 commit b162347

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/Macro.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,9 @@ protected function addLocationToPhpDoc()
9898
$enclosingClass = $this->method->getClosureScopeClass();
9999
}
100100

101+
if (!$enclosingClass) {
102+
return;
103+
}
101104
/** @var \ReflectionMethod $enclosingMethod */
102105
$enclosingMethod = Collection::make($enclosingClass->getMethods())
103106
->first(function (\ReflectionMethod $method) {

0 commit comments

Comments
 (0)