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

Deprecate functionality to be removed #1441

Open
wants to merge 2 commits into
base: v1.20
Choose a base branch
from

Conversation

alcaeus
Copy link
Member

@alcaeus alcaeus commented Sep 23, 2024

This PR adds deprecations for the modifiers and oplogReplay options in find operations (PHPLIB-1532) as well as the Collection::mapReduce method (PHPLIB-1533).

@alcaeus alcaeus requested a review from a team as a code owner September 23, 2024 14:34
Copy link
Member

@GromNaN GromNaN left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -927,6 +931,8 @@ public function listSearchIndexes(array $options = []): Iterator
*/
public function mapReduce(JavascriptInterface $map, JavascriptInterface $reduce, $out, array $options = [])
{
@trigger_error(sprintf('The %s method is deprecated and will be removed in a future release.', __METHOD__), E_USER_DEPRECATED);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will you remove it in version 2.0? In that case, you can mention the version here.

Suggested change
@trigger_error(sprintf('The %s method is deprecated and will be removed in a future release.', __METHOD__), E_USER_DEPRECATED);
@trigger_error(sprintf('The %s method is deprecated and will be removed in version 2.0.', __METHOD__), E_USER_DEPRECATED);


if (isset($options['oplogReplay'])) {
@trigger_error('The "oplogReplay" option is deprecated and will be removed in a future release', E_USER_DEPRECATED);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excluding modifiers, PHPC raises its own E_DEPRECATED notice these options in the Query constructor. Does that mean users would see two deprecation notices?

As for modifiers, that seems like something we should add in PHPC 1.x before we remove the option entirely in 2.0 (PHPC-2440). I created PHPC-2452 and opened mongodb/mongo-php-driver#1677 to address that.

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.

3 participants