diff --git a/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/MarkdownDescriptor.php b/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/MarkdownDescriptor.php
index 2b4b7d70c97aa..5b4a1b0887a1f 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/MarkdownDescriptor.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/MarkdownDescriptor.php
@@ -56,7 +56,7 @@ protected function describeRoute(Route $route, array $options = array())
."\n".'- Method: '.($route->getMethods() ? implode('|', $route->getMethods()) : 'ANY')
."\n".'- Class: '.get_class($route)
."\n".'- Defaults: '.$this->formatRouterConfig($route->getDefaults())
- ."\n".'- Requirements: '.$this->formatRouterConfig($requirements) ?: 'NONE'
+ ."\n".'- Requirements: '.($requirements ? $this->formatRouterConfig($requirements) : 'NO CUSTOM')
."\n".'- Options: '.$this->formatRouterConfig($route->getOptions());
$this->write(isset($options['name'])
diff --git a/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php b/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php
index fb506deff9039..8bb803e36c655 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php
@@ -79,7 +79,7 @@ protected function describeRoute(Route $route, array $options = array())
'Method '.($route->getMethods() ? implode('|', $route->getMethods()) : 'ANY'),
'Class '.get_class($route),
'Defaults '.$this->formatRouterConfig($route->getDefaults()),
- 'Requirements '.$this->formatRouterConfig($requirements) ?: 'NO CUSTOM',
+ 'Requirements '.($requirements ? $this->formatRouterConfig($requirements) : 'NO CUSTOM'),
'Options '.$this->formatRouterConfig($route->getOptions()),
);
@@ -306,6 +306,10 @@ protected function describeContainerParameter($parameter, array $options = array
*/
private function formatRouterConfig(array $array)
{
+ if (!count($array)) {
+ return 'NONE';
+ }
+
$string = '';
ksort($array);
foreach ($array as $name => $value) {
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_1.md b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_1.md
index c292438b0a7b5..5bb091889b7b1 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_1.md
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_1.md
@@ -8,4 +8,8 @@
- Defaults:
- `name`: Joseph
- Requirements:
- - `name`: [a-z]+
\ No newline at end of file
+ - `name`: [a-z]+
+- Options:
+ - `compiler_class`: Symfony\Component\Routing\RouteCompiler
+ - `opt1`: val1
+ - `opt2`: val2
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_1.txt b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_1.txt
index 502dfc4628584..d6d2aa38b7523 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_1.txt
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_1.txt
@@ -9,4 +9,4 @@
Requirements name: [a-z]+
Options compiler_class: Symfony\Component\Routing\RouteCompiler
opt1: val1
- opt2: val2
\ No newline at end of file
+ opt2: val2
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_2.md b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_2.md
index 1cbb0e3004acc..41b185495205c 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_2.md
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_2.md
@@ -6,4 +6,8 @@
- Method: PUT|POST
- Class: Symfony\Component\Routing\Route
- Defaults: NONE
-- Requirements: NONE
\ No newline at end of file
+- Requirements: NO CUSTOM
+- Options:
+ - `compiler_class`: Symfony\Component\Routing\RouteCompiler
+ - `opt1`: val1
+ - `opt2`: val2
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_2.txt b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_2.txt
index 96b7a616fe185..8c1a143123922 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_2.txt
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_2.txt
@@ -5,8 +5,8 @@
Scheme http|https
Method PUT|POST
Class Symfony\Component\Routing\Route
-Defaults
-Requirements
+Defaults NONE
+Requirements NO CUSTOM
Options compiler_class: Symfony\Component\Routing\RouteCompiler
opt1: val1
- opt2: val2
\ No newline at end of file
+ opt2: val2
diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_collection_1.md b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_collection_1.md
index 24950b1f577b4..a1ae684674ab4 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_collection_1.md
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_collection_1.md
@@ -12,6 +12,10 @@ route_1
- `name`: Joseph
- Requirements:
- `name`: [a-z]+
+- Options:
+ - `compiler_class`: Symfony\Component\Routing\RouteCompiler
+ - `opt1`: val1
+ - `opt2`: val2
route_2
@@ -25,4 +29,8 @@ route_2
- Method: PUT|POST
- Class: Symfony\Component\Routing\Route
- Defaults: NONE
-- Requirements: NONE
+- Requirements: NO CUSTOM
+- Options:
+ - `compiler_class`: Symfony\Component\Routing\RouteCompiler
+ - `opt1`: val1
+ - `opt2`: val2