Skip to content

Commit 1eff42d

Browse files
Merge branch '5.4' into 6.4
* 5.4: Fix CI Bump ext-redis in CI on PHP >= 8.4 Adjust pretty name of closures on PHP 8.4 implement NodeVisitorInterface instead of extending AbstractNodeVisitor
2 parents 4e465a9 + 2a8c64b commit 1eff42d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

LazyString.php

+1-1
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 = \PHP_VERSION_ID >= 80111 ? $r->getClosureCalledClass() : $r->getClosureScopeClass()) {
132+
if (str_contains($r->name, '{closure') || !$class = \PHP_VERSION_ID >= 80111 ? $r->getClosureCalledClass() : $r->getClosureScopeClass()) {
133133
return $r->name;
134134
}
135135

Tests/LazyStringTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function testReturnTypeError()
3939
$s = LazyString::fromCallable(fn () => []);
4040

4141
$this->expectException(\TypeError::class);
42-
$this->expectExceptionMessage('Return value of '.__NAMESPACE__.'\{closure}() passed to '.LazyString::class.'::fromCallable() must be of the type string, array returned.');
42+
$this->expectExceptionMessageMatches('{^Return value of .*\{closure.*\}\(\) passed to '.preg_quote(LazyString::class).'::fromCallable\(\) must be of the type string, array returned\.$}');
4343

4444
(string) $s;
4545
}

0 commit comments

Comments
 (0)