From 76ca2c9b9efddad5ade150b656efe10119a81acf Mon Sep 17 00:00:00 2001 From: Maciej Koprek Date: Wed, 8 Jan 2025 10:24:19 +0100 Subject: [PATCH] Remove PHP 8.4.* deprecations (#733) Co-authored-by: Maciej Koprek --- .github/workflows/test.yaml | 14 ++++---------- Command/BaseRabbitMqCommand.php | 2 +- DataCollector/MessageDataCollector.php | 2 +- RabbitMq/AMQPConnectionFactory.php | 2 +- RabbitMq/BaseAmqp.php | 2 +- RabbitMq/BatchConsumer.php | 2 +- RabbitMq/Consumer.php | 2 +- RabbitMq/Producer.php | 2 +- 8 files changed, 11 insertions(+), 17 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index c4b62f77..b1cff17c 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -15,8 +15,8 @@ jobs: strategy: matrix: - php-version: ['7.4', '8.2'] - symfony-version: ['4.4', '5.3', '5.4', '6.4', '7.0'] + php-version: ['7.4', '8.4'] + symfony-version: ['5.4', '6.4', '7.4'] coverage: ['none'] exclude: - php-version: '7.4' @@ -28,16 +28,10 @@ jobs: symfony-version: '5.4' coverage: xdebug - php-version: '8.1' - symfony-version: '6.2' - coverage: 'none' - - php-version: '8.1' - symfony-version: '6.1' - coverage: 'none' - - php-version: '8.1' - symfony-version: '6.3' + symfony-version: '6.4' coverage: 'none' - php-version: '8.2' - symfony-version: '6.3' + symfony-version: '6.4' coverage: 'none' steps: diff --git a/Command/BaseRabbitMqCommand.php b/Command/BaseRabbitMqCommand.php index c4ae61eb..c8a80e05 100644 --- a/Command/BaseRabbitMqCommand.php +++ b/Command/BaseRabbitMqCommand.php @@ -12,7 +12,7 @@ abstract class BaseRabbitMqCommand extends Command */ protected $container; - public function setContainer(ContainerInterface $container = null): void + public function setContainer(?ContainerInterface $container = null): void { $this->container = $container; } diff --git a/DataCollector/MessageDataCollector.php b/DataCollector/MessageDataCollector.php index 09932da6..95b7f7f4 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) { foreach ($this->channels as $channel) { foreach ($channel->getBasicPublishLog() as $log) { diff --git a/RabbitMq/AMQPConnectionFactory.php b/RabbitMq/AMQPConnectionFactory.php index 765307fe..f97aea54 100644 --- a/RabbitMq/AMQPConnectionFactory.php +++ b/RabbitMq/AMQPConnectionFactory.php @@ -41,7 +41,7 @@ class AMQPConnectionFactory public function __construct( $class, array $parameters, - ConnectionParametersProviderInterface $parametersProvider = null + ?ConnectionParametersProviderInterface $parametersProvider = null ) { $this->class = $class; $this->parameters = array_merge($this->parameters, $parameters); diff --git a/RabbitMq/BaseAmqp.php b/RabbitMq/BaseAmqp.php index fd65438b..bcb625f2 100644 --- a/RabbitMq/BaseAmqp.php +++ b/RabbitMq/BaseAmqp.php @@ -63,7 +63,7 @@ abstract class BaseAmqp * @param AMQPChannel|null $ch * @param string|null $consumerTag */ - public function __construct(AbstractConnection $conn, AMQPChannel $ch = null, $consumerTag = null) + public function __construct(AbstractConnection $conn, ?AMQPChannel $ch = null, $consumerTag = null) { $this->conn = $conn; $this->ch = $ch; diff --git a/RabbitMq/BatchConsumer.php b/RabbitMq/BatchConsumer.php index 88756389..a7bca68c 100644 --- a/RabbitMq/BatchConsumer.php +++ b/RabbitMq/BatchConsumer.php @@ -81,7 +81,7 @@ class BatchConsumer extends BaseAmqp implements DequeuerInterface /** * @param \DateTime|null $dateTime */ - public function setGracefulMaxExecutionDateTime(\DateTime $dateTime = null) + public function setGracefulMaxExecutionDateTime(?\DateTime $dateTime = null) { $this->gracefulMaxExecutionDateTime = $dateTime; } diff --git a/RabbitMq/Consumer.php b/RabbitMq/Consumer.php index 73eb63ee..9df43f07 100644 --- a/RabbitMq/Consumer.php +++ b/RabbitMq/Consumer.php @@ -234,7 +234,7 @@ protected function isRamAlmostOverloaded() /** * @param \DateTime|null $dateTime */ - public function setGracefulMaxExecutionDateTime(\DateTime $dateTime = null) + public function setGracefulMaxExecutionDateTime(?\DateTime $dateTime = null) { $this->gracefulMaxExecutionDateTime = $dateTime; } diff --git a/RabbitMq/Producer.php b/RabbitMq/Producer.php index 571ce3b7..6a42d4d3 100644 --- a/RabbitMq/Producer.php +++ b/RabbitMq/Producer.php @@ -51,7 +51,7 @@ protected function getBasicProperties() * @param array $additionalProperties * @param array $headers */ - public function publish($msgBody, $routingKey = null, $additionalProperties = [], array $headers = null) + public function publish($msgBody, $routingKey = null, $additionalProperties = [], ?array $headers = null) { if ($this->autoSetupFabric) { $this->setupFabric();