From cc829544c8a80c117e2cdb9a86d4e22d38e49d9b Mon Sep 17 00:00:00 2001 From: Alessandro Lai Date: Tue, 19 Nov 2024 23:03:47 +0100 Subject: [PATCH 1/3] Test against PHP 8.4 --- .github/workflows/ci.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 0b29a0a..84565e2 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -29,6 +29,10 @@ jobs: php: ['8.3'] mongodb: ['1.17.2'] include: + - description: Tests - PHP 8.4 + php: '8.4' + symfony-version: '7.*' + mongodb: '1.20.0' # 1.20 introduced PHP 8.4 support - description: Tests - Symfony 6.4 php: '8.2' symfony-version: '6.4.*' From e46ee5b8e1e7c4b4868010bc33108ad3c629dbb3 Mon Sep 17 00:00:00 2001 From: Alessandro Lai Date: Wed, 20 Nov 2024 10:16:09 +0100 Subject: [PATCH 2/3] Fix PHP 8.4 deprecations (implicit nullable arguments) # Conflicts: # tests/Stubs/NotInstantiableDocumentEnhancer.php --- src/Transport/Connection.php | 2 +- src/Transport/MongoDbUnresettableTransport.php | 2 +- src/Transport/Receiver.php | 2 +- tests/Stubs/InstantiableDocumentEnhancer.php | 2 +- tests/Stubs/NotInstantiableDocumentEnhancer.php | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Transport/Connection.php b/src/Transport/Connection.php index 93b2f69..03d21ab 100644 --- a/src/Transport/Connection.php +++ b/src/Transport/Connection.php @@ -179,7 +179,7 @@ public function find(string $id): ?BSONDocument /** * @return Cursor */ - public function findAll(int $limit = null): Cursor + public function findAll(?int $limit = null): Cursor { $options = []; if ($limit !== null) { diff --git a/src/Transport/MongoDbUnresettableTransport.php b/src/Transport/MongoDbUnresettableTransport.php index 773f266..8afb794 100644 --- a/src/Transport/MongoDbUnresettableTransport.php +++ b/src/Transport/MongoDbUnresettableTransport.php @@ -62,7 +62,7 @@ public function send(Envelope $envelope): Envelope * * @return \Generator */ - public function all(int $limit = null): iterable + public function all(?int $limit = null): iterable { return $this->getReceiver()->all($limit); } diff --git a/src/Transport/Receiver.php b/src/Transport/Receiver.php index a191a88..ea403bd 100644 --- a/src/Transport/Receiver.php +++ b/src/Transport/Receiver.php @@ -68,7 +68,7 @@ public function reject(Envelope $envelope): void /** * @return \Generator */ - public function all(int $limit = null): iterable + public function all(?int $limit = null): iterable { foreach ($this->connection->findAll($limit) as $document) { yield $this->createEnvelope($document); diff --git a/tests/Stubs/InstantiableDocumentEnhancer.php b/tests/Stubs/InstantiableDocumentEnhancer.php index bef4893..4787ac1 100644 --- a/tests/Stubs/InstantiableDocumentEnhancer.php +++ b/tests/Stubs/InstantiableDocumentEnhancer.php @@ -13,7 +13,7 @@ class InstantiableDocumentEnhancer implements DocumentEnhancer /** @var \DateTime|null */ private $foo; - public function __construct(\DateTime $foo = null) + public function __construct(?\DateTime $foo = null) { $this->foo = $foo; } diff --git a/tests/Stubs/NotInstantiableDocumentEnhancer.php b/tests/Stubs/NotInstantiableDocumentEnhancer.php index ed324ac..4cef559 100644 --- a/tests/Stubs/NotInstantiableDocumentEnhancer.php +++ b/tests/Stubs/NotInstantiableDocumentEnhancer.php @@ -10,7 +10,7 @@ class NotInstantiableDocumentEnhancer implements DocumentEnhancer { - public function __construct(\DateTime $bar, \DateTime $foo = null) {} + public function __construct(\DateTime $bar, ?\DateTime $foo = null) {} public function enhance(BSONDocument $document, Envelope $envelope): void {} } From 95e4ae39967cc18624f80581488527800afd5fcf Mon Sep 17 00:00:00 2001 From: Alessandro Lai Date: Mon, 9 Dec 2024 18:25:23 +0100 Subject: [PATCH 3/3] Add changelog entry --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 397230f..df19c4d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,9 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## 1.4.1 (2024-12-09) +* Add support to PHP 8.4 (by removing implicit nullable arguments deprecations) + ## 1.4.0 (2024-03-15) * Allow Symfony 7 ([#18](https://github.com/facile-it/mongodb-messenger-transport/issues/18)) * Require at least `facile-it/mongodb-bundle` 1.6