Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add return type void in FindAndModifyCommandSubscriber.php to avoid deprecation warnings #2913

Merged
merged 2 commits into from Apr 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
@@ -1,6 +1,10 @@
# Changelog
All notable changes to this project will be documented in this file.

## [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)
Expand Down
6 changes: 3 additions & 3 deletions src/Internal/FindAndModifyCommandSubscriber.php
Expand Up @@ -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;
}
Expand Down