Skip to content

Commit 5630355

Browse files
committed
Also use formatting in route details
1 parent d3bc464 commit 5630355

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ protected function describeRoute(Route $route, array $options = []): void
133133
['Host', '' !== $route->getHost() ? $route->getHost() : 'ANY'],
134134
['Host Regex', '' !== $route->getHost() ? $route->compile()->getHostRegex() : ''],
135135
['Scheme', $route->getSchemes() ? implode('|', $route->getSchemes()) : 'ANY'],
136-
['Method', $route->getMethods() ? implode('|', $route->getMethods()) : 'ANY'],
136+
['Method', $this->formatMethods($route->getMethods())],
137137
['Requirements', $route->getRequirements() ? $this->formatRouterConfig($route->getRequirements()) : 'NO CUSTOM'],
138138
['Class', $route::class],
139139
['Defaults', $this->formatRouterConfig($defaults)],
@@ -606,13 +606,16 @@ private function formatRouterConfig(array $config): string
606606
return trim($configAsString);
607607
}
608608

609+
/**
610+
* @param array<string> $methods
611+
*/
609612
private function formatMethods(array $methods): string
610613
{
611614
if (!$methods) {
612615
$methods = ['ANY'];
613616
}
614617

615-
return implode('<fg=#6C7280>|</>', array_map(
618+
return implode('|', array_map(
616619
fn (string $method): string => '<fg='.self::VERB_COLORS[$method].'>'.$method.'</>',
617620
$methods
618621
));

0 commit comments

Comments
 (0)