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
  • Loading branch information
staabm authored May 25, 2024
1 parent d14e93e commit 4b948a2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Job/CallbackJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use ReflectionFunction;
use function getcwd;
use function sprintf;
use function str_ends_with;
use function str_contains;
use function str_replace;
use const DIRECTORY_SEPARATOR;

Expand All @@ -29,7 +29,7 @@ public function getName(): string
$ref = new ReflectionFunction($this->callback);
$refName = $ref->getName();

if (str_ends_with($refName, '{closure}')) {
if (str_contains($refName, '{closure')) {
$name = sprintf(
'%s:%s',
str_replace(getcwd() . DIRECTORY_SEPARATOR, '', $ref->getFileName()),
Expand Down

0 comments on commit 4b948a2

Please sign in to comment.