diff --git a/composer.json b/composer.json index 879395b..b0a111d 100644 --- a/composer.json +++ b/composer.json @@ -13,7 +13,7 @@ "ext-pcntl": "*", "krak/schema": "^0.2.0", "psr/event-dispatcher": "^1.0", - "symfony/messenger": "^4.4|^5.4|^6.2" + "symfony/messenger": "^4.4|^5.4|^6.2|~7.0" }, "autoload": { "psr-4": { diff --git a/src/Command/AlertCommand.php b/src/Command/AlertCommand.php index 16c3e28..4214c99 100644 --- a/src/Command/AlertCommand.php +++ b/src/Command/AlertCommand.php @@ -26,7 +26,7 @@ protected function configure() { ->setDescription('Raise any of the configured alerts.'); } - protected function execute(InputInterface $input, OutputInterface $output) { + protected function execute(InputInterface $input, OutputInterface $output): int { foreach ($this->supervisorPoolConfigs as $poolConfig) { foreach (($this->raiseAlerts)($poolConfig) as $event) { $this->eventDispatcher->dispatch($event); diff --git a/src/Command/ConsumeCommand.php b/src/Command/ConsumeCommand.php index 5f26b1b..2fdfafd 100644 --- a/src/Command/ConsumeCommand.php +++ b/src/Command/ConsumeCommand.php @@ -21,7 +21,7 @@ protected function configure() { ->setDescription('Start the supervisor to manage the worker consumers.'); } - protected function execute(InputInterface $input, OutputInterface $output) { + protected function execute(InputInterface $input, OutputInterface $output): int { $output->writeln('Starting Supervisor.'); $this->supervisor->run(); return 0; diff --git a/src/Command/Pool/PauseCommand.php b/src/Command/Pool/PauseCommand.php index 98abcea..7dda5b7 100644 --- a/src/Command/Pool/PauseCommand.php +++ b/src/Command/Pool/PauseCommand.php @@ -13,7 +13,7 @@ protected function configure() { ->addPoolArgument('The names of the pools to perform a pause'); } - protected function execute(InputInterface $input, OutputInterface $output) { + protected function execute(InputInterface $input, OutputInterface $output): int { $poolNames = $this->getPoolNames($input); foreach ($poolNames as $poolName) { $control = $this->poolControlFactory->createForActor($poolName); diff --git a/src/Command/Pool/RestartCommand.php b/src/Command/Pool/RestartCommand.php index 6f38d95..2219d91 100644 --- a/src/Command/Pool/RestartCommand.php +++ b/src/Command/Pool/RestartCommand.php @@ -13,7 +13,7 @@ protected function configure() { ->addPoolArgument('The names of the pools to perform a restart'); } - protected function execute(InputInterface $input, OutputInterface $output) { + protected function execute(InputInterface $input, OutputInterface $output): int { $poolNames = $this->getPoolNames($input); foreach ($poolNames as $poolName) { $control = $this->poolControlFactory->createForActor($poolName); diff --git a/src/Command/Pool/ResumeCommand.php b/src/Command/Pool/ResumeCommand.php index 6c12193..769521a 100644 --- a/src/Command/Pool/ResumeCommand.php +++ b/src/Command/Pool/ResumeCommand.php @@ -13,7 +13,7 @@ protected function configure() { ->addPoolArgument('The names of the pools to perform a resume'); } - protected function execute(InputInterface $input, OutputInterface $output) { + protected function execute(InputInterface $input, OutputInterface $output): int { $poolNames = $this->getPoolNames($input); foreach ($poolNames as $poolName) { $control = $this->poolControlFactory->createForActor($poolName); diff --git a/src/Command/Pool/StatusCommand.php b/src/Command/Pool/StatusCommand.php index 79a5f54..e9bb243 100644 --- a/src/Command/Pool/StatusCommand.php +++ b/src/Command/Pool/StatusCommand.php @@ -19,7 +19,7 @@ protected function configure() { ->addOption('poll-interval', 'i', InputOption::VALUE_REQUIRED, 'The interval to poll at, defaults to 5 seconds', 5); } - protected function execute(InputInterface $input, OutputInterface $output) { + protected function execute(InputInterface $input, OutputInterface $output): int { $poolNames = $this->getPoolNames($input); $shouldPoll = $input->getOption('poll'); $pollInterval = $input->getOption('poll-interval'); diff --git a/src/EventLogger.php b/src/EventLogger.php index 269fb84..64a021a 100644 --- a/src/EventLogger.php +++ b/src/EventLogger.php @@ -25,7 +25,7 @@ public function logEvent(string $message, string $event, array $context = []): v ]); } - public function log($level, $message, array $context = array()) { + public function log($level, string|\Stringable $message, array $context = []): void { $this->logger->log($level, $message, $context); } } diff --git a/src/MessengerAutoScaleBundle.php b/src/MessengerAutoScaleBundle.php index ad1b0a9..362b724 100644 --- a/src/MessengerAutoScaleBundle.php +++ b/src/MessengerAutoScaleBundle.php @@ -4,6 +4,7 @@ use Symfony\Component\Config\Definition\Builder\BooleanNodeDefinition; use Symfony\Component\Config\Definition\Builder\ScalarNodeDefinition; +use Symfony\Component\Config\Definition\Builder\TreeBuilder; use Symfony\Component\Config\Definition\ConfigurationInterface; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Extension\Extension; @@ -49,7 +50,7 @@ public function load(array $configs, ContainerBuilder $container): void { public function getConfiguration(array $config, ContainerBuilder $container) { return new class() implements ConfigurationInterface { - public function getConfigTreeBuilder() { + public function getConfigTreeBuilder(): TreeBuilder { return configTree('messenger_auto_scale', struct([ 'console_path' => string(['configure' => function(ScalarNodeDefinition $def) { $def->defaultValue('%kernel.project_dir%/bin/console'); diff --git a/src/PoolConfig.php b/src/PoolConfig.php index 473163d..ad49f7a 100644 --- a/src/PoolConfig.php +++ b/src/PoolConfig.php @@ -83,7 +83,7 @@ public function attributes(): array { return $this->attributes; } - public function jsonSerialize() { + public function jsonSerialize(): mixed { return get_object_vars($this); } }