File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -173,21 +173,19 @@ called "output sections". Create one or more of these sections when you need to
173173clear and overwrite the output information.
174174
175175Sections are created with the
176- :method: `Symfony\\ Component\\ Console\\ Output\\ ConsoleOutput::section ` method,
177- which returns an instance of
176+ :method: `ConsoleOutput::section() < Symfony\\ Component\\ Console\\ Output\\ ConsoleOutput::section> `
177+ method, which returns an instance of
178178:class: `Symfony\\ Component\\ Console\\ Output\\ ConsoleSectionOutput `::
179179
180+ // ...
181+ use Symfony\Component\Console\Output\ConsoleOutputInterface;
182+
180183 class MyCommand extends Command
181184 {
182185 protected function execute(InputInterface $input, OutputInterface $output)
183186 {
184- // The section() method is only available in classes that implement ConsoleOutputInterface
185187 if (!$output instanceof ConsoleOutputInterface) {
186- throw new LogicException(sprintf(
187- 'This command accepts only an instance of "%s", an instance of "%s" is given',
188- ConsoleOutputInterface::class,
189- \get_class($output)
190- ));
188+ throw new \LogicException('This command accepts only an instance of "ConsoleOutputInterface".');
191189 }
192190
193191 $section1 = $output->section();
You can’t perform that action at this time.
0 commit comments