fix when no enclosingClass can be found (#1239)

In certain situations no enclosingClass can be found, quick fix is to just return then.
This commit is contained in:
Jan Misker
2021-08-04 11:12:34 +02:00
committed by GitHub
parent f4e0fc3695
commit b162347aff
+3
View File
@@ -98,6 +98,9 @@ class Macro extends Method
$enclosingClass = $this->method->getClosureScopeClass();
}
if (!$enclosingClass) {
return;
}
/** @var \ReflectionMethod $enclosingMethod */
$enclosingMethod = Collection::make($enclosingClass->getMethods())
->first(function (\ReflectionMethod $method) {