minor #19713 [FrameworkBundle] Remove duplicated code in RouterDebugCommand (JhonnyL)
This PR was merged into the 2.7 branch.
Discussion
----------
[FrameworkBundle] Remove duplicated code in RouterDebugCommand
| Q | A
| ------------- | ---
| Branch? | 2.7
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets |
| License | MIT
| Doc PR |
Commits
-------
20a69aa
[FrameworkBundle] Remove duplicated code in RouterDebugCommand
This commit is contained in:
commit
d30c3184df
@ -83,10 +83,10 @@ EOF
|
|||||||
|
|
||||||
$name = $input->getArgument('name');
|
$name = $input->getArgument('name');
|
||||||
$helper = new DescriptorHelper();
|
$helper = new DescriptorHelper();
|
||||||
|
$routes = $this->getContainer()->get('router')->getRouteCollection();
|
||||||
|
|
||||||
if ($name) {
|
if ($name) {
|
||||||
$route = $this->getContainer()->get('router')->getRouteCollection()->get($name);
|
if (!$route = $routes->get($name)) {
|
||||||
if (!$route) {
|
|
||||||
throw new \InvalidArgumentException(sprintf('The route "%s" does not exist.', $name));
|
throw new \InvalidArgumentException(sprintf('The route "%s" does not exist.', $name));
|
||||||
}
|
}
|
||||||
$this->convertController($route);
|
$this->convertController($route);
|
||||||
@ -96,8 +96,6 @@ EOF
|
|||||||
'name' => $name,
|
'name' => $name,
|
||||||
));
|
));
|
||||||
} else {
|
} else {
|
||||||
$routes = $this->getContainer()->get('router')->getRouteCollection();
|
|
||||||
|
|
||||||
foreach ($routes as $route) {
|
foreach ($routes as $route) {
|
||||||
$this->convertController($route);
|
$this->convertController($route);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user