Skip to content

Commit 4aca703

Browse files
committed
minor #18606 [FrameworkBundle] Remove duplicated code in ContainerDebugCommand (JhonnyL)
This PR was merged into the 2.7 branch. Discussion ---------- [FrameworkBundle] Remove duplicated code in ContainerDebugCommand | 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 ------- 5885cbc [FrameworkBundle] Remove duplicated code in ContainerDebugCommand
2 parents a795388 + 5885cbc commit 4aca703

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/Symfony/Bundle/FrameworkBundle/Command/ContainerDebugCommand.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,25 +99,21 @@ protected function execute(InputInterface $input, OutputInterface $output)
9999
}
100100

101101
$this->validateInput($input);
102+
$object = $this->getContainerBuilder();
102103

103104
if ($input->getOption('parameters')) {
104-
$object = $this->getContainerBuilder()->getParameterBag();
105+
$object = $object->getParameterBag();
105106
$options = array();
106107
} elseif ($parameter = $input->getOption('parameter')) {
107-
$object = $this->getContainerBuilder();
108108
$options = array('parameter' => $parameter);
109109
} elseif ($input->getOption('tags')) {
110-
$object = $this->getContainerBuilder();
111110
$options = array('group_by' => 'tags', 'show_private' => $input->getOption('show-private'));
112111
} elseif ($tag = $input->getOption('tag')) {
113-
$object = $this->getContainerBuilder();
114112
$options = array('tag' => $tag, 'show_private' => $input->getOption('show-private'));
115113
} elseif ($name = $input->getArgument('name')) {
116-
$object = $this->getContainerBuilder();
117114
$name = $this->findProperServiceName($input, $output, $object, $name);
118115
$options = array('id' => $name);
119116
} else {
120-
$object = $this->getContainerBuilder();
121117
$options = array('show_private' => $input->getOption('show-private'));
122118
}
123119

0 commit comments

Comments
 (0)