mongodb / mongo-php-driver

The Official MongoDB PHP driver
https://pecl.php.net/package/mongodb
Apache License 2.0
878 stars 199 forks source link

PHPC-1489: Deprecate integer readPreference constants #1604

Closed alcaeus closed 1 week ago

alcaeus commented 2 weeks ago

PHPC-1489

This deprecates the RP_* constants in MongoDB\Driver\ReadPreference constants, along with passing an int in the constructor and using getMode.

Note that PHP 8.3 and newer automagically triggers warnings when using deprecated warnings. Calling deprecated methods results in a warning starting in PHP 7.4 (albeit with a wrong message in PHP 7.4).

alcaeus commented 2 weeks ago

Do you keep any test that use the legacy constants to ensure they still work even if they are deprecated?

Added now.

alcaeus commented 2 weeks ago

Note: I'll have to revisit the failing Windows Build tasks for PHP 7.4 and 8.0 separately - deferring the merge until those have been taken care of.