Skip to content

Commit 0dde9fd

Browse files
committed
minor #17175 [Console] Add return for execute() (mohamedGasmii)
This PR was merged into the 5.4 branch. Discussion ---------- [Console] Add return for execute() Return value of execute() must be of the type int <!-- If your pull request fixes a BUG, use the oldest maintained branch that contains the bug (see https://symfony.com/releases for the list of maintained branches). If your pull request documents a NEW FEATURE, use the same Symfony branch where the feature was introduced (and `6.x` for features of unreleased versions). --> Commits ------- 4361e9e [Console] Add return for execute()
2 parents ea1965e + 4361e9e commit 0dde9fd

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

components/console/helpers/table.rst

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ set the headers, set the rows and then render the table::
2828

2929
class SomeCommand extends Command
3030
{
31-
public function execute(InputInterface $input, OutputInterface $output)
31+
public function execute(InputInterface $input, OutputInterface $output): int
3232
{
3333
$table = new Table($output);
3434
$table
@@ -41,6 +41,8 @@ set the headers, set the rows and then render the table::
4141
])
4242
;
4343
$table->render();
44+
45+
return Command::SUCCESS;
4446
}
4547
}
4648

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

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

417419
$table->appendRow(['Symfony']);
420+
421+
return Command::SUCCESS;
418422
}
419423
}
420424

0 commit comments

Comments
 (0)