Skip to content

[Console] Add return for execute() #17175

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 15, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions components/console/helpers/table.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ set the headers, set the rows and then render the table::

class SomeCommand extends Command
{
public function execute(InputInterface $input, OutputInterface $output)
public function execute(InputInterface $input, OutputInterface $output): int
{
$table = new Table($output);
$table
Expand All @@ -41,6 +41,8 @@ set the headers, set the rows and then render the table::
])
;
$table->render();

return Command::SUCCESS;
}
}

Expand Down Expand Up @@ -406,7 +408,7 @@ The only requirement to append rows is that the table must be rendered inside a

class SomeCommand extends Command
{
public function execute(InputInterface $input, OutputInterface $output)
public function execute(InputInterface $input, OutputInterface $output): int
{
$section = $output->section();
$table = new Table($section);
Expand All @@ -415,6 +417,8 @@ The only requirement to append rows is that the table must be rendered inside a
$table->render();

$table->appendRow(['Symfony']);

return Command::SUCCESS;
}
}

Expand Down