Skip to content

Commit f8e3d0d

Browse files
committed
Fix Command::execute() to return int
See symfony/symfony#33747
1 parent d3669b6 commit f8e3d0d

5 files changed

Lines changed: 15 additions & 5 deletions

File tree

src/Console/Command/KickCommand.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ protected function configure(): void
1919
;
2020
}
2121

22-
protected function execute(InputInterface $input, OutputInterface $output): void
22+
protected function execute(InputInterface $input, OutputInterface $output): int
2323
{
2424
$queue = $this->createConfigFactory($input, $output)->createQueue();
2525
$count = $input->getArgument('count');
@@ -31,5 +31,7 @@ protected function execute(InputInterface $input, OutputInterface $output): void
3131
$affected,
3232
$queue->getName()
3333
));
34+
35+
return 0;
3436
}
3537
}

src/Console/Command/PutCommand.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ protected function configure(): void
1919
;
2020
}
2121

22-
protected function execute(InputInterface $input, OutputInterface $output): void
22+
protected function execute(InputInterface $input, OutputInterface $output): int
2323
{
2424
$json = $input->getArgument('json-data');
2525
$data = json_decode($json, true);
@@ -37,5 +37,7 @@ protected function execute(InputInterface $input, OutputInterface $output): void
3737
$queue->getName(),
3838
$task->getId()
3939
));
40+
41+
return 0;
4042
}
4143
}

src/Console/Command/RunCommand.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ protected function configure(): void
2424
;
2525
}
2626

27-
protected function execute(InputInterface $input, OutputInterface $output): void
27+
protected function execute(InputInterface $input, OutputInterface $output): int
2828
{
2929
$configFactory = $this->createConfigFactory($input, $output);
3030

@@ -40,5 +40,7 @@ protected function execute(InputInterface $input, OutputInterface $output): void
4040

4141
$runner = $configFactory->createRunner();
4242
$runner->run($input->getOption('idle-timeout'));
43+
44+
return 0;
4345
}
4446
}

src/Console/Command/StatsCommand.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,16 @@ protected function configure(): void
1717
;
1818
}
1919

20-
protected function execute(InputInterface $input, OutputInterface $output): void
20+
protected function execute(InputInterface $input, OutputInterface $output): int
2121
{
2222
$queue = $this->createConfigFactory($input, $output)->createQueue();
2323
$stats = $queue->stats();
2424

2525
$output->writeln(sprintf('Queue: <options=bold>%s</>', $queue->getName()));
2626
$output->writeln('Tasks: '.self::buildLine($stats['tasks']));
2727
$output->writeln('Calls: '.self::buildLine($stats['calls']));
28+
29+
return 0;
2830
}
2931

3032
private static function buildLine(array $stats): string

src/Console/Command/TruncateCommand.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,13 @@ protected function configure(): void
1717
;
1818
}
1919

20-
protected function execute(InputInterface $input, OutputInterface $output): void
20+
protected function execute(InputInterface $input, OutputInterface $output): int
2121
{
2222
$queue = $this->createConfigFactory($input, $output)->createQueue();
2323
$queue->truncate();
2424

2525
$output->writeln(sprintf('<info>%s</info> was successfully truncated.', $queue->getName()));
26+
27+
return 0;
2628
}
2729
}

0 commit comments

Comments
 (0)