diff --git a/src/Support/ReflectionClosure.php b/src/Support/ReflectionClosure.php index e489996b..48bb1f28 100644 --- a/src/Support/ReflectionClosure.php +++ b/src/Support/ReflectionClosure.php @@ -1169,8 +1169,14 @@ protected function getClosureNamespaceName() { $ns = $this->getNamespaceName(); + $name = $this->getName(); + // First class callables... - if ($this->getName() !== '{closure}' && empty($ns) && ! is_null($this->getClosureScopeClass())) { + if ($name !== '{closure}' + && ! str_contains($name, '{closure:/') + && ! str_contains($name, '{closure:\\') + && empty($ns) + && ! is_null($this->getClosureScopeClass())) { $ns = $this->getClosureScopeClass()->getNamespaceName(); }