Skip to content

Commit

Permalink
Fixes regular non namespaced closures being consider callables (#97)
Browse files Browse the repository at this point in the history
  • Loading branch information
nunomaduro authored Nov 7, 2024
1 parent d738882 commit 1065ae7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Support/ReflectionClosure.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down

0 comments on commit 1065ae7

Please sign in to comment.