Skip to content

Commit

Permalink
Widen support for symfony console 5.x, and implement backwards compat…
Browse files Browse the repository at this point in the history
…ible (to PHP 7.1) signature
  • Loading branch information
scottaubrey committed Dec 16, 2024
1 parent de3dc49 commit 33d97c2
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"require-dev": {
"phpunit/phpunit": "^6.5 | ^9.5",
"squizlabs/php_codesniffer": "^3.5",
"symfony/console": "^2.7 || ^3.2"
"symfony/console": "^2.7 || ^3.2 || ^4.4 || ^5.0"
},
"conflict": {
"sebastian/comparator": "<1.2.3"
Expand Down
4 changes: 3 additions & 1 deletion src/Command/QueueCleanCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@ protected function configure()
->setDescription('Cleans the SQS queue through purging.');
}

public function execute(InputInterface $input, OutputInterface $output)
public function execute(InputInterface $input, OutputInterface $output): int
{
$this->logger->info('Cleaning queue: '.$this->queue->getName());
$this->queue->clean();

return 0;
}
}
4 changes: 3 additions & 1 deletion src/Command/QueueCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,15 @@ protected function configure()
->setDescription('Watches SQS for changes.');
}

final public function execute(InputInterface $input, OutputInterface $output)
final public function execute(InputInterface $input, OutputInterface $output): int
{
$this->logger->info($this->getName().' Started listening.');
while (!$this->limit->hasBeenReached()) {
$this->loop($input);
}
$this->logger->info($this->getName().' Stopped because of limits reached.');

return 0;
}

final protected function transform(QueueItem $item)
Expand Down
4 changes: 3 additions & 1 deletion src/Command/QueueCountCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@ protected function configure()
->setDescription('Counts the SQS messages, including invisible ones. Approximate.');
}

public function execute(InputInterface $input, OutputInterface $output)
public function execute(InputInterface $input, OutputInterface $output): int
{
$output->writeln($this->queue->count());

return 0;
}
}

0 comments on commit 33d97c2

Please sign in to comment.