Skip to content

Commit e09e19d

Browse files
Oleg Maksimenkomac-cain13
authored andcommitted
Actualize ExampleCommand
1 parent f3050ec commit e09e19d

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

examples/ExampleCommand.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ protected function initialize(InputInterface $input, OutputInterface $output)
2323
}
2424

2525
// Execute will be called in a endless loop
26-
protected function execute(InputInterface $input, OutputInterface $output)
26+
protected function execute(InputInterface $input, OutputInterface $output): int
2727
{
2828
// Tell the user what we're going to do.
2929
// This will be silenced by Symfony if the user doesn't want any output at all,
@@ -52,21 +52,23 @@ protected function execute(InputInterface $input, OutputInterface $output)
5252
// Tell the user we're done
5353
$output->writeln('done');
5454
}
55+
56+
return self::SUCCESS;
5557
}
5658

5759
/**
5860
* Called after each iteration
5961
* @param InputInterface $input
6062
* @param OutputInterface $output
6163
*/
62-
protected function finishIteration(InputInterface $input, OutputInterface $output)
64+
protected function finishIteration(InputInterface $input, OutputInterface $output): void
6365
{
6466
// Do some cleanup/memory management here, don't forget to call the parent implementation!
6567
parent::finishIteration($input, $output);
6668
}
6769

6870
// Called once on shutdown after the last iteration finished
69-
protected function finalize(InputInterface $input, OutputInterface $output)
71+
protected function finalize(InputInterface $input, OutputInterface $output): void
7072
{
7173
// Do some cleanup here, don't forget to call the parent implementation!
7274
parent::finalize($input, $output);

0 commit comments

Comments
 (0)