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

Conversation

wivaku
Copy link
Contributor

@wivaku wivaku commented Apr 25, 2024

Using $model::firstOrCreate(...)
currently results in deprecation warnings.
Can be addressed by adding void return type.

Warnings:

   DEPRECATED  Return type of MongoDB\Laravel\Internal\FindAndModifyCommandSubscriber::commandStarted(MongoDB\Driver\Monitoring\CommandStartedEvent $event) should either be compatible with MongoDB\Driver\Monitoring\CommandSubscriber::commandStarted(MongoDB\Driver\Monitoring\CommandStartedEvent $event): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in vendor/mongodb/laravel-mongodb/src/Internal/FindAndModifyCommandSubscriber.php on line 26.


   DEPRECATED  Return type of MongoDB\Laravel\Internal\FindAndModifyCommandSubscriber::commandSucceeded(MongoDB\Driver\Monitoring\CommandSucceededEvent $event) should either be compatible with MongoDB\Driver\Monitoring\CommandSubscriber::commandSucceeded(MongoDB\Driver\Monitoring\CommandSucceededEvent $event): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in vendor/mongodb/laravel-mongodb/src/Internal/FindAndModifyCommandSubscriber.php on line 30.


   DEPRECATED  Return type of MongoDB\Laravel\Internal\FindAndModifyCommandSubscriber::commandFailed(MongoDB\Driver\Monitoring\CommandFailedEvent $event) should either be compatible with MongoDB\Driver\Monitoring\CommandSubscriber::commandFailed(MongoDB\Driver\Monitoring\CommandFailedEvent $event): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in vendor/mongodb/laravel-mongodb/src/Internal/FindAndModifyCommandSubscriber.php on line 22.

Checklist

  • Add tests and ensure they pass
  • Add an entry to the CHANGELOG.md file
  • Update documentation for new features

@wivaku wivaku requested a review from a team as a code owner April 25, 2024 10:44
@wivaku wivaku requested a review from alcaeus April 25, 2024 10:44
Using $model::firstOrCreate(...)
currently results in deprecation warnings.  
Can be addressed by adding `void` return type.

Warnings: 
```
   DEPRECATED  Return type of MongoDB\Laravel\Internal\FindAndModifyCommandSubscriber::commandStarted(MongoDB\Driver\Monitoring\CommandStartedEvent $event) should either be compatible with MongoDB\Driver\Monitoring\CommandSubscriber::commandStarted(MongoDB\Driver\Monitoring\CommandStartedEvent $event): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in vendor/mongodb/laravel-mongodb/src/Internal/FindAndModifyCommandSubscriber.php on line 26.


   DEPRECATED  Return type of MongoDB\Laravel\Internal\FindAndModifyCommandSubscriber::commandSucceeded(MongoDB\Driver\Monitoring\CommandSucceededEvent $event) should either be compatible with MongoDB\Driver\Monitoring\CommandSubscriber::commandSucceeded(MongoDB\Driver\Monitoring\CommandSucceededEvent $event): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in vendor/mongodb/laravel-mongodb/src/Internal/FindAndModifyCommandSubscriber.php on line 30.


   DEPRECATED  Return type of MongoDB\Laravel\Internal\FindAndModifyCommandSubscriber::commandFailed(MongoDB\Driver\Monitoring\CommandFailedEvent $event) should either be compatible with MongoDB\Driver\Monitoring\CommandSubscriber::commandFailed(MongoDB\Driver\Monitoring\CommandFailedEvent $event): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in vendor/mongodb/laravel-mongodb/src/Internal/FindAndModifyCommandSubscriber.php on line 22.
```
@GromNaN GromNaN changed the base branch from 4.3 to 4.2 April 25, 2024 13:48
@GromNaN GromNaN enabled auto-merge (squash) April 25, 2024 13:49
@GromNaN
Copy link
Member

GromNaN commented Apr 25, 2024

Good catch, thank you @wivaku.

@GromNaN GromNaN merged commit 7654b17 into mongodb:4.2 Apr 25, 2024
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants