Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed compatibility of EventLogger::log with PSR log #8

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion src/Command/AlertCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/Command/ConsumeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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('<info>Starting Supervisor.</info>');
$this->supervisor->run();
return 0;
Expand Down
2 changes: 1 addition & 1 deletion src/Command/Pool/PauseCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/Command/Pool/RestartCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/Command/Pool/ResumeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/Command/Pool/StatusCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
2 changes: 1 addition & 1 deletion src/EventLogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
3 changes: 2 additions & 1 deletion src/MessengerAutoScaleBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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');
Expand Down
2 changes: 1 addition & 1 deletion src/PoolConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public function attributes(): array {
return $this->attributes;
}

public function jsonSerialize() {
public function jsonSerialize(): mixed {
return get_object_vars($this);
}
}
Loading