mongo-php-driver icon indicating copy to clipboard operation
mongo-php-driver copied to clipboard

PHPC-1489: Deprecate integer readPreference constants

Open alcaeus opened this issue 1 year ago • 2 comments

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 avatar Jul 05 '24 09:07 alcaeus

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

Added now.

alcaeus avatar Jul 05 '24 11:07 alcaeus

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.

alcaeus avatar Jul 05 '24 11:07 alcaeus