Skip to content

Commit af65296

Browse files
bug #40802 [FrameworkBundle] Fix array controller link in debug:router (fancyweb)
This PR was merged into the 5.2 branch. Discussion ---------- [FrameworkBundle] Fix array controller link in debug:router | Q | A | ------------- | --- | Branch? | 5.2 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - `debug:router` is broken when you add a route in the Kernel (see https://symfony.com/doc/current/configuration/micro_kernel_trait.html) because `kernel` is not a class and triggers a `\ReflectionException`. The code in the exception handling always expect `$controller` to be a string. Commits ------- be964bdfa6 [FrameworkBundle] Fix array controller link in debug:router
2 parents 05015f9 + 11c5471 commit af65296

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Console/Descriptor/TextDescriptor.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,10 @@ private function formatControllerLink($controller, string $anchorText, callable
554554
$r = new \ReflectionFunction($controller);
555555
}
556556
} catch (\ReflectionException $e) {
557+
if (\is_array($controller)) {
558+
$controller = implode('::', $controller);
559+
}
560+
557561
$id = $controller;
558562
$method = '__invoke';
559563

0 commit comments

Comments
 (0)