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.*' 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 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 {} }