Skip to content

Commit a1d4879

Browse files
Adjust pretty name of closures on PHP 8.4
1 parent fa8b095 commit a1d4879

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

Console/Descriptor/JsonDescriptor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ private function getCallableData($callable): array
356356
$data['type'] = 'closure';
357357

358358
$r = new \ReflectionFunction($callable);
359-
if (str_contains($r->name, '{closure}')) {
359+
if (str_contains($r->name, '{closure')) {
360360
return $data;
361361
}
362362
$data['name'] = $r->name;

Console/Descriptor/MarkdownDescriptor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ protected function describeCallable($callable, array $options = [])
372372
$string .= "\n- Type: `closure`";
373373

374374
$r = new \ReflectionFunction($callable);
375-
if (str_contains($r->name, '{closure}')) {
375+
if (str_contains($r->name, '{closure')) {
376376
return $this->write($string."\n");
377377
}
378378
$string .= "\n".sprintf('- Name: `%s`', $r->name);

Console/Descriptor/TextDescriptor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,7 @@ private function formatCallable($callable): string
611611

612612
if ($callable instanceof \Closure) {
613613
$r = new \ReflectionFunction($callable);
614-
if (str_contains($r->name, '{closure}')) {
614+
if (str_contains($r->name, '{closure')) {
615615
return 'Closure()';
616616
}
617617
if ($class = \PHP_VERSION_ID >= 80111 ? $r->getClosureCalledClass() : $r->getClosureScopeClass()) {

Console/Descriptor/XmlDescriptor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,7 @@ private function getCallableDocument($callable): \DOMDocument
543543
$callableXML->setAttribute('type', 'closure');
544544

545545
$r = new \ReflectionFunction($callable);
546-
if (str_contains($r->name, '{closure}')) {
546+
if (str_contains($r->name, '{closure')) {
547547
return $dom;
548548
}
549549
$callableXML->setAttribute('name', $r->name);

0 commit comments

Comments
 (0)