Skip to content

Commit 58ea93b

Browse files
Merge branch '5.4' into 6.4
* 5.4: Fix CI Bump ext-redis in CI on PHP >= 8.4 Adjust pretty name of closures on PHP 8.4 implement NodeVisitorInterface instead of extending AbstractNodeVisitor
2 parents e1aaae1 + a1d4879 commit 58ea93b

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

Console/Descriptor/JsonDescriptor.php

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

395395
$r = new \ReflectionFunction($callable);
396-
if (str_contains($r->name, '{closure}')) {
396+
if (str_contains($r->name, '{closure')) {
397397
return $data;
398398
}
399399
$data['name'] = $r->name;

Console/Descriptor/MarkdownDescriptor.php

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

405405
$r = new \ReflectionFunction($callable);
406-
if (str_contains($r->name, '{closure}')) {
406+
if (str_contains($r->name, '{closure')) {
407407
$this->write($string."\n");
408408

409409
return;

Console/Descriptor/TextDescriptor.php

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

650650
if ($callable instanceof \Closure) {
651651
$r = new \ReflectionFunction($callable);
652-
if (str_contains($r->name, '{closure}')) {
652+
if (str_contains($r->name, '{closure')) {
653653
return 'Closure()';
654654
}
655655
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
@@ -581,7 +581,7 @@ private function getCallableDocument(mixed $callable): \DOMDocument
581581
$callableXML->setAttribute('type', 'closure');
582582

583583
$r = new \ReflectionFunction($callable);
584-
if (str_contains($r->name, '{closure}')) {
584+
if (str_contains($r->name, '{closure')) {
585585
return $dom;
586586
}
587587
$callableXML->setAttribute('name', $r->name);

Kernel/MicroKernelTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ public function loadRoutes(LoaderInterface $loader): RouteCollection
217217

218218
if (\is_array($controller) && [0, 1] === array_keys($controller) && $this === $controller[0]) {
219219
$route->setDefault('_controller', ['kernel', $controller[1]]);
220-
} elseif ($controller instanceof \Closure && $this === ($r = new \ReflectionFunction($controller))->getClosureThis() && !str_contains($r->name, '{closure}')) {
220+
} elseif ($controller instanceof \Closure && $this === ($r = new \ReflectionFunction($controller))->getClosureThis() && !str_contains($r->name, '{closure')) {
221221
$route->setDefault('_controller', ['kernel', $r->name]);
222222
}
223223
}

0 commit comments

Comments
 (0)