diff --git a/CHANGELOG.md b/CHANGELOG.md index 63f494272..ffd240b43 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,10 @@ All notable changes to this project will be documented in this file. * Fix `artisan query:retry` command by @GromNaN in [#2838](https://github.com/mongodb/laravel-mongodb/pull/2838) * Add `mongodb` cache and lock drivers by @GromNaN in [#2877](https://github.com/mongodb/laravel-mongodb/pull/2877) +## [4.2.2] - 2024-04-25 + +* Add return types to `FindAndModifyCommandSubscriber`, used by `firstOrCreate` by @wivaku in [#2913](https://github.com/mongodb/laravel-mongodb/pull/2913) + ## [4.2.1] - 2024-04-25 * Set timestamps when using `Model::createOrFirst()` by @GromNaN in [#2905](https://github.com/mongodb/laravel-mongodb/pull/2905) diff --git a/src/Internal/FindAndModifyCommandSubscriber.php b/src/Internal/FindAndModifyCommandSubscriber.php index 55b13436b..335e05562 100644 --- a/src/Internal/FindAndModifyCommandSubscriber.php +++ b/src/Internal/FindAndModifyCommandSubscriber.php @@ -19,15 +19,15 @@ final class FindAndModifyCommandSubscriber implements CommandSubscriber { public bool $created; - public function commandFailed(CommandFailedEvent $event) + public function commandFailed(CommandFailedEvent $event): void { } - public function commandStarted(CommandStartedEvent $event) + public function commandStarted(CommandStartedEvent $event): void { } - public function commandSucceeded(CommandSucceededEvent $event) + public function commandSucceeded(CommandSucceededEvent $event): void { $this->created = ! $event->getReply()->lastErrorObject->updatedExisting; }