8000 Replace NO CONDITION by empty for md and txt format and take out for … · symfony/symfony@2261fbe · GitHub
[go: up one dir, main page]

Skip to content

Commit 2261fbe

Browse files
committed
Replace NO CONDITION by empty for md and txt format and take out for json like xml
1 parent 05a4829 commit 2261fbe

File tree

8 files changed

+14
-11
lines changed

8 files changed

+14
-11
lines changed

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ private function writeData(array $data, array $options)
193193
*/
194194
protected function getRouteData(Route $route)
195195
{
196-
return array(
196+
$data = array(
197197
'path' => $route->getPath(),
198198
'pathRegex' => $route->compile()->getRegex(),
199199
'host' => '' !== $route->getHost() ? $route->getHost() : 'ANY',
@@ -204,8 +204,13 @@ protected function getRouteData(Route $route)
204204
'defaults' => $route->getDefaults(),
205205
'requirements' => $route->getRequirements() ?: 'NO CUSTOM',
206206
'options' => $route->getOptions(),
207-
'condition' => '' !== $route->getCondition() ? $route->getCondition() : 'NO CONDITION',
208207
);
208+
209+
if ('' !== $route->getCondition()) {
210+
$data['condition'] = $route->getCondition();
211+
}
212+
213+
return $data;
209214
}
210215

211216
private function getContainerDefinitionData(Definition $definition, bool $omitTags = false, bool $showArguments = false): array

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ protected function describeRoute(Route $route, array $options = array())
5959
."\n".'- Defaults: '.$this->formatRouterConfig($route->getDefaults())
6060
."\n".'- Requirements: '.($route->getRequirements() ? $this->formatRouterConfig($route->getRequirements()) : 'NO CUSTOM')
6161
."\n".'- Options: '.$this->formatRouterConfig($route->getOptions())
62-
."\n".'- Condition: '.('' !== $route->getCondition() ? $route->getCondition() : 'NO CONDITION');
62+
."\n".'- Condition: '.('' !== $route->getCondition() ? $route->getCondition() : '');
6363

6464
$this->write(isset($options['name'])
6565
? $options['name']."\n".str_repeat('-', \strlen($options['name']))."\n\n".$output

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ protected function describeRoute(Route $route, array $options = array())
9090
array('Class', \get_class($route)),
9191
array('Defaults', $this->formatRouterConfig($route->getDefaults())),
9292
array('Options', $this->formatRouterConfig($route->getOptions())),
93-
array('Condition', ('' !== $route->getCondition() ? $route->getCondition() : 'NO CONDITION')),
93+
array('Condition', ('' !== $route->getCondition() ? $route->getCondition() : '')),
9494
);
9595

9696
$table = new Table($this->getOutput());

src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_1.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,5 @@
1616
"compiler_class": "Symfony\\Component\\Routing\\RouteCompiler",
1717
"opt1": "val1",
1818
"opt2": "val2"
19-
},
20-
"condition": "NO CONDITION"
19+
}
2120
}

src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_1.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
- `compiler_class`: Symfony\Component\Routing\RouteCompiler
1414
- `opt1`: val1
1515
- `opt2`: val2
16-
- Condition: NO CONDITION
16+
- Condition:

src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_1.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@
1414
| Options | compiler_class: Symfony\Component\Routing\RouteCompiler |
1515
| | opt1: val1 |
1616
| | opt2: val2 |
17-
| Condition | NO CONDITION |
17+
| Condition | |
1818
+--------------+-------------------------------------------------------------------+

src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_collection_1.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@
1717
"compiler_class": "Symfony\\Component\\Routing\\RouteCompiler",
1818
"opt1": "val1",
1919
"opt2": "val2"
20-
},
21-
"condition": "NO CONDITION"
20+
}
2221
},
2322
"route_2": {
2423
"path": "\/name\/add",

src/Symfony/Bundle/FrameworkBundle/Tests/Fixtures/Descriptor/route_collection_1.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ route_1
1616
- `compiler_class`: Symfony\Component\Routing\RouteCompiler
1717
- `opt1`: val1
1818
- `opt2`: val2
19-
- Condition: NO CONDITION
19+
- Condition:
2020

2121

2222
route_2

0 commit comments

Comments
 (0)
0