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

PHPLIB-1489: Handle CursorId deprecations #1366

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

alcaeus
Copy link
Member

@alcaeus alcaeus commented Jul 25, 2024

PHPLIB-1489

This PR complements mongodb/mongo-php-driver#1616 by introducing the same $asInt64 argument to all classes that implement CursorInterface::getId or wrap a cursor class. Not providing the argument or providing false as a value will trigger a deprecation warning to inform the user they need to update. In 2.0, we can deprecate the parameter and change the return type of the methods to Int64.

@alcaeus alcaeus self-assigned this Jul 25, 2024
@alcaeus alcaeus requested a review from a team as a code owner July 25, 2024 10:28
@alcaeus alcaeus requested a review from GromNaN July 25, 2024 10:28
public function getId(): CursorId
/** @return CursorId|Int64 */
#[ReturnTypeWillChange]
public function getId(bool $asInt64 = false)
Copy link
Member

Choose a reason for hiding this comment

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

For BC layer, adding an argument should be virtual (func_get_arg).

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