Skip to content

Commit 1cb3ad5

Browse files
Leverage ReflectionFunction::isAnonymous()
1 parent 2e64730 commit 1cb3ad5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

LazyString.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ private static function getPrettyName(callable $callback): string
129129
} elseif ($callback instanceof \Closure) {
130130
$r = new \ReflectionFunction($callback);
131131

132-
if (str_contains($r->name, '{closure}') || !$class = $r->getClosureCalledClass()) {
132+
if ($r->isAnonymous() || !$class = $r->getClosureCalledClass()) {
133133
return $r->name;
134134
}
135135

0 commit comments

Comments
 (0)