Skip to content

Commit

Permalink
Adjust pretty name of closures on PHP 8.4
Browse files Browse the repository at this point in the history
related to php/php-src#13550

see analog symfony change: symfony/symfony#54614
  • Loading branch information
staabm authored May 25, 2024
1 parent fb9a74e commit fb6564a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils/Utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ final class Utils{
*/
public static function getNiceClosureName(\Closure $closure) : string{
$func = new \ReflectionFunction($closure);
if(!str_ends_with($func->getName(), '{closure}')){
if(!str_contains($func->getName(), '{closure')){
//closure wraps a named function, can be done with reflection or fromCallable()
//isClosure() is useless here because it just tells us if $func is reflecting a Closure object

Expand Down

0 comments on commit fb6564a

Please sign in to comment.