We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 23ed1d4 commit 663e817Copy full SHA for 663e817
console.rst
@@ -195,8 +195,14 @@ which returns an instance of
195
{
196
protected function execute(InputInterface $input, OutputInterface $output)
197
198
- $section1 = $output->section();
199
- $section2 = $output->section();
+ // section() method available only in classes implement ConsoleOutputInterface
+ if ($output instanceof ConsoleOutputInterface) {
200
+ $section1 = $output->section();
201
+ $section2 = $output->section();
202
+ } else {
203
+ $section1 = $section2 = $output;
204
+ }
205
+
206
$section1->writeln('Hello');
207
$section2->writeln('World!');
208
// Output displays "Hello\nWorld!\n"
0 commit comments