diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index ba8da949..df8043ce 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -11,7 +11,7 @@ jobs: strategy: matrix: php-version: ['8.2', '8.3', '8.4', '8.5'] - symfony-version: ['6.4', '7.4'] + symfony-version: ['6.4', '7.4', '8.0'] coverage: ['none'] include: - php-version: '8.3' diff --git a/DataCollector/MessageDataCollector.php b/DataCollector/MessageDataCollector.php index 95b7f7f4..34350c78 100644 --- a/DataCollector/MessageDataCollector.php +++ b/DataCollector/MessageDataCollector.php @@ -21,7 +21,7 @@ public function __construct($channels) $this->data = []; } - public function collect(Request $request, Response $response, ?\Throwable $exception = null) + public function collect(Request $request, Response $response, ?\Throwable $exception = null): void { foreach ($this->channels as $channel) { foreach ($channel->getBasicPublishLog() as $log) { @@ -30,22 +30,22 @@ public function collect(Request $request, Response $response, ?\Throwable $excep } } - public function getName() + public function getName(): string { return 'rabbit_mq'; } - public function getPublishedMessagesCount() + public function getPublishedMessagesCount(): int { return count($this->data); } - public function getPublishedMessagesLog() + public function getPublishedMessagesLog(): array { return $this->data; } - public function reset() + public function reset(): void { $this->data = []; } diff --git a/Tests/Command/SetupFabricCommandTest.php b/Tests/Command/SetupFabricCommandTest.php index f7f92143..09e61109 100644 --- a/Tests/Command/SetupFabricCommandTest.php +++ b/Tests/Command/SetupFabricCommandTest.php @@ -54,7 +54,13 @@ public function testExecute(): void $command->setContainer($container); // TODO: Use addCommand() once Symfony Support for < 7.4 is dropped - $application->add($command); + // TODO: Use addCommand() once Symfony Support for < 7.4 is dropped + if (method_exists($application, 'addCommand')) { + $application->addCommand($command); + } else { + // @phpstan-ignore-next-line + $application->add($command); + } $registeredCommand = $application->find('rabbitmq:setup-fabric'); @@ -102,7 +108,13 @@ public function testExecute_withSkipAnonConsumers(): void $command->setContainer($container); // TODO: Use addCommand() once Symfony Support for < 7.4 is dropped - $application->add($command); + // TODO: Use addCommand() once Symfony Support for < 7.4 is dropped + if (method_exists($application, 'addCommand')) { + $application->addCommand($command); + } else { + // @phpstan-ignore-next-line + $application->add($command); + } $registeredCommand = $application->find('rabbitmq:setup-fabric'); diff --git a/composer.json b/composer.json index 42978a8d..f541082b 100644 --- a/composer.json +++ b/composer.json @@ -8,19 +8,19 @@ "name" : "Alvaro Videla" }], "require": { - "php": "^8.2", - "symfony/dependency-injection": "^6.0 || ^7.0", - "symfony/event-dispatcher": "^6.0 || ^7.0", - "symfony/config": "^6.0 || ^7.0", - "symfony/yaml": "^6.0 || ^7.0", - "symfony/console": "^6.0 || ^7.0", + "php": "^8.4", + "symfony/dependency-injection": "^6.0 || ^7.0 || ^8.0", + "symfony/event-dispatcher": "^6.0 || ^7.0 || ^8.0", + "symfony/config": "^6.0 || ^7.0 || ^8.0", + "symfony/yaml": "^6.0 || ^7.0 || ^8.0", + "symfony/console": "^6.0 || ^7.0 || ^8.0", "php-amqplib/php-amqplib": "^2.12.2 || ^3.0", "psr/log": "^2.0 || ^3.0", - "symfony/http-kernel": "^6.0 || ^7.0", - "symfony/framework-bundle": "^6.0 || ^7.0" + "symfony/http-kernel": "^6.0 || ^7.0 || ^8.0", + "symfony/framework-bundle": "^6.0 || ^7.0 || ^8.0" }, "require-dev": { - "symfony/serializer": "^6.0 || ^7.0", + "symfony/serializer": "^6.0 || ^7.0 || ^8.0", "phpunit/phpunit": "^9.5", "phpstan/phpstan": "^1.2", "phpstan/phpstan-phpunit": "^1.0"