Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust pretty name of closures on PHP 8.4 #6351

Open
wants to merge 2 commits into
base: stable
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/utils/Utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
use function preg_replace;
use function shell_exec;
use function spl_object_id;
use function str_ends_with;
use function str_contains;
use function str_pad;
use function str_split;
use function str_starts_with;
Expand Down 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