improved readability

This commit is contained in:
lsmith77 2012-04-17 10:08:22 +02:00
parent b06537e351
commit 98a00526ad

View File

@ -87,7 +87,11 @@ EOF
$maxMethod = 6;
foreach ($routes as $name => $route) {
$requirements = $route->getRequirements();
$method = isset($requirements['_method']) ? strtoupper(is_array($requirements['_method']) ? implode(', ', $requirements['_method']) : $requirements['_method']) : 'ANY';
$method = isset($requirements['_method'])
? strtoupper(is_array($requirements['_method'])
? implode(', ', $requirements['_method']) : $requirements['_method']
)
: 'ANY';
if (strlen($name) > $maxName) {
$maxName = strlen($name);
@ -104,7 +108,11 @@ EOF
$output->writeln(sprintf($format1, '<comment>Name</comment>', '<comment>Method</comment>', '<comment>Pattern</comment>'));
foreach ($routes as $name => $route) {
$requirements = $route->getRequirements();
$method = isset($requirements['_method']) ? strtoupper(is_array($requirements['_method']) ? implode(', ', $requirements['_method']) : $requirements['_method']) : 'ANY';
$method = isset($requirements['_method'])
? strtoupper(is_array($requirements['_method'])
? implode(', ', $requirements['_method']) : $requirements['_method']
)
: 'ANY';
$output->writeln(sprintf($format, $name, $method, $route->getPattern()));
}
}