Skip to content

Update stubs for ext-mongodb 2.0 #1729

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

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

Conversation

alcaeus
Copy link
Contributor

@alcaeus alcaeus commented Apr 10, 2025

I opted for making the 2.0 version the only version we support. I'm not sure if we could use conditional class definitions to cover both 1.x and 2.x, I'd rather have people use this as motivation to move away from 1.x

@alcaeus alcaeus force-pushed the mongodb-ext-2.0 branch 2 times, most recently from 8304519 to 9bdc376 Compare April 10, 2025 11:44
@alcaeus
Copy link
Contributor Author

alcaeus commented Apr 10, 2025

@isfedorov CI seems to be having a bad day - it fails before even finishing setting up docker containers.

@isfedorov
Copy link
Contributor

@alcaeus Please try to rebase. I've removed problematic dependency

@alcaeus
Copy link
Contributor Author

alcaeus commented Apr 11, 2025

@isfedorov thank you, that looks "better". Now it's my fault for the red CI, will check that out and fix it in the coming days.

@alcaeus
Copy link
Contributor Author

alcaeus commented Apr 17, 2025

I'm not completely familiar with the test setup, but I can only assume that the failures are because we removed some constants in the 2.0 version of the extension, while reflection output still sees them there. This would indicate that the 1.x extension is somehow installed, but I can't find where, the only place that explicitly mentions the MongoDB extension is the tests/DockerImages/peclExtensions image, but installation is disabled there and can't be enabled as the image uses PHP 8.0 which is no longer supported by us.

@isfedorov can you point me in the right direction for fixing tests? Is there a way to mark constants, methods, or classes as removed in an extension release instead of completely removing them from the stubs?

@isfedorov
Copy link
Contributor

@alcaeus as far as I can see the issue is related to the fact that removed constant is used in .meta file meta/.phpstorm.meta.php . It uses this constant as an expected argument's value expectedArguments(\MongoDB\Driver\ReadPreference::__construct(), 0, \MongoDB\Driver\ReadPreference::RP_PRIMARY,\MongoDB\Driver\ReadPreference::RP_PRIMARY_PREFERRED,\MongoDB\Driver\ReadPreference::RP_SECONDARY,\MongoDB\Driver\ReadPreference::RP_SECONDARY_PREFERRED,\MongoDB\Driver\ReadPreference::RP_NEAREST); so you need to update this usage

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.

2 participants