Skip to content

Commit e710b37

Browse files
authored
Adjust pretty name of closures on PHP 8.4 (#6351)
related to php/php-src#13550 see analog symfony change: symfony/symfony#54614
1 parent faf1e26 commit e710b37

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/utils/Utils.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
use function preg_replace;
8181
use function shell_exec;
8282
use function spl_object_id;
83-
use function str_ends_with;
83+
use function str_contains;
8484
use function str_pad;
8585
use function str_split;
8686
use function str_starts_with;
@@ -121,7 +121,7 @@ final class Utils{
121121
*/
122122
public static function getNiceClosureName(\Closure $closure) : string{
123123
$func = new \ReflectionFunction($closure);
124-
if(!str_ends_with($func->getName(), '{closure}')){
124+
if(!str_contains($func->getName(), '{closure')){
125125
//closure wraps a named function, can be done with reflection or fromCallable()
126126
//isClosure() is useless here because it just tells us if $func is reflecting a Closure object
127127

0 commit comments

Comments
 (0)