diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/RouterDebugCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/RouterDebugCommand.php
index 161438674a..18aeaa9af0 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Command/RouterDebugCommand.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Command/RouterDebugCommand.php
@@ -92,9 +92,7 @@ EOF
? implode(', ', $requirements['_method']) : $requirements['_method']
)
: 'ANY';
- $hostname = '' !== $route->getHostnamePattern()
- ? $route->getHostnamePattern() : 'ANY';
-
+ $hostname = '' !== $route->getHostnamePattern() ? $route->getHostnamePattern() : 'ANY';
$maxName = max($maxName, strlen($name));
$maxMethod = max($maxMethod, strlen($method));
$maxHostname = max($maxHostname, strlen($hostname));
@@ -111,8 +109,7 @@ EOF
? implode(', ', $requirements['_method']) : $requirements['_method']
)
: 'ANY';
- $hostname = '' !== $route->getHostnamePattern()
- ? $route->getHostnamePattern() : 'ANY';
+ $hostname = '' !== $route->getHostnamePattern() ? $route->getHostnamePattern() : 'ANY';
$output->writeln(sprintf($format, $name, $method, $hostname, $route->getPattern()));
}
}
@@ -127,10 +124,13 @@ EOF
throw new \InvalidArgumentException(sprintf('The route "%s" does not exist.', $name));
}
+ $hostname = '' !== $route->getHostnamePattern() ? $route->getHostnamePattern() : 'ANY';
+
$output->writeln($this->getHelper('formatter')->formatSection('router', sprintf('Route "%s"', $name)));
$output->writeln(sprintf('Name %s', $name));
$output->writeln(sprintf('Pattern %s', $route->getPattern()));
+ $output->writeln(sprintf('HostnamePattern %s', $hostname));
$output->writeln(sprintf('Class %s', get_class($route)));
$defaults = '';
@@ -139,7 +139,7 @@ EOF
foreach ($d as $name => $value) {
$defaults .= ($defaults ? "\n".str_repeat(' ', 13) : '').$name.': '.$this->formatValue($value);
}
- $output->writeln(sprintf('Defaults %s', $defaults));
+ $output->writeln(sprintf('Defaults %s', $defaults));
$requirements = '';
$r = $route->getRequirements();
@@ -147,7 +147,8 @@ EOF
foreach ($r as $name => $value) {
$requirements .= ($requirements ? "\n".str_repeat(' ', 13) : '').$name.': '.$this->formatValue($value);
}
- $output->writeln(sprintf('Requirements %s', $requirements));
+ $requirements = '' !== $requirements ? $route->getHostnamePattern() : 'NONE';
+ $output->writeln(sprintf('Requirements %s', $requirements));
$options = '';
$o = $route->getOptions();
@@ -155,8 +156,8 @@ EOF
foreach ($o as $name => $value) {
$options .= ($options ? "\n".str_repeat(' ', 13) : '').$name.': '.$this->formatValue($value);
}
- $output->writeln(sprintf('Options %s', $options));
- $output->write('Regex ');
+ $output->writeln(sprintf('Options %s', $options));
+ $output->write('Regex ');
$output->writeln(preg_replace('/^ /', '', preg_replace('/^/m', ' ', $route->compile()->getRegex())), OutputInterface::OUTPUT_RAW);
}