Skip to content

Commit 6eb665a

Browse files
committed
Only show relevant columns in debug:router
1 parent bd7a1d2 commit 6eb665a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ class TextDescriptor extends Descriptor
4141
private const VERB_COLORS = [
4242
'ANY' => 'default',
4343
'GET' => 'blue',
44+
'QUERY' => 'blue',
4445
'HEAD' => 'magenta',
4546
'OPTIONS' => 'blue',
4647
'POST' => 'green',
@@ -84,7 +85,7 @@ protected function describeRouteCollection(RouteCollection $routes, array $optio
8485
}
8586

8687
if ($showAliases) {
87-
$row['Aliases'] = implode('|', ($this->getReverseAliases($routes))[$name] ?? []);
88+
$row['Aliases'] = implode('|', $this->getReverseAliases($routes)[$name] ?? []);
8889
}
8990

9091
$tableRows[] = $row;
@@ -616,12 +617,12 @@ private function formatRouterConfig(array $config): string
616617
*/
617618
private function formatMethods(array $methods): string
618619
{
619-
if (count($methods) === 0) {
620+
if ([] === $methods) {
620621
$methods = ['ANY'];
621622
}
622623

623624
return implode('|', array_map(
624-
fn (string $method): string => sprintf('<fg=%s>%s</>', self::VERB_COLORS[$method] ?? 'default', $method),
625+
fn (string $method): string => \sprintf('<fg=%s>%s</>', self::VERB_COLORS[$method] ?? 'default', $method),
625626
$methods
626627
));
627628
}

0 commit comments

Comments
 (0)