From a73304acb528dcabbbaf97385f91b0e5fded4bcd Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Wed, 18 Sep 2024 14:47:52 +0200 Subject: [PATCH] PHPC-2402: Remove range_preview constants --- UPGRADE-2.0.md | 3 +++ src/MongoDB/ClientEncryption.stub.php | 14 -------------- src/MongoDB/ClientEncryption_arginfo.h | 16 +--------------- .../clientEncryption-constants.phpt | 4 ---- 4 files changed, 4 insertions(+), 33 deletions(-) diff --git a/UPGRADE-2.0.md b/UPGRADE-2.0.md index 1f0134cdb..137ad9beb 100644 --- a/UPGRADE-2.0.md +++ b/UPGRADE-2.0.md @@ -6,3 +6,6 @@ UPGRADE FROM 1.x to 2.0 and `getPort()` methods have been added in its place. * The BSON functions in the `MongoDB\BSON` namespace have been removed in favor of the `MongoDB\BSON\Document` class. + * The constants `MongoDB\Driver\ClientEncryption::ALGORITHM_RANGE_PREVIEW` and + `MongoDB\Driver\ClientEncryption::QUERY_TYPE_RANGE_PREVIEW` have been + removed. Use the `ALGORITHM_RANGE` and `QUERY_TYPE_RANGE` instead. diff --git a/src/MongoDB/ClientEncryption.stub.php b/src/MongoDB/ClientEncryption.stub.php index 19f2881f9..96e3f2755 100644 --- a/src/MongoDB/ClientEncryption.stub.php +++ b/src/MongoDB/ClientEncryption.stub.php @@ -40,13 +40,6 @@ final class ClientEncryption */ public const ALGORITHM_RANGE = UNKNOWN; - /** - * @deprecated - * @var string - * @cvalue MONGOC_ENCRYPT_ALGORITHM_RANGEPREVIEW - */ - public const ALGORITHM_RANGE_PREVIEW = UNKNOWN; - /** * @var string * @cvalue MONGOC_ENCRYPT_QUERY_TYPE_EQUALITY @@ -59,13 +52,6 @@ final class ClientEncryption */ public const QUERY_TYPE_RANGE = UNKNOWN; - /** - * @deprecated - * @var string - * @cvalue MONGOC_ENCRYPT_QUERY_TYPE_RANGEPREVIEW - */ - public const QUERY_TYPE_RANGE_PREVIEW = UNKNOWN; - final public function __construct(array $options) {} final public function addKeyAltName(\MongoDB\BSON\Binary $keyId, string $keyAltName): ?object {} diff --git a/src/MongoDB/ClientEncryption_arginfo.h b/src/MongoDB/ClientEncryption_arginfo.h index b262af8a9..ea7d6f4c6 100644 --- a/src/MongoDB/ClientEncryption_arginfo.h +++ b/src/MongoDB/ClientEncryption_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 29a1460703051cab24abd6b42228c90928e18049 */ + * Stub hash: ea16be50be5151fdd45b9e1bc37856d94990725e */ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_MongoDB_Driver_ClientEncryption___construct, 0, 0, 1) ZEND_ARG_TYPE_INFO(0, options, IS_ARRAY, 0) @@ -125,13 +125,6 @@ static zend_class_entry *register_class_MongoDB_Driver_ClientEncryption(void) zend_declare_class_constant_ex(class_entry, const_ALGORITHM_RANGE_name, &const_ALGORITHM_RANGE_value, ZEND_ACC_PUBLIC, NULL); zend_string_release(const_ALGORITHM_RANGE_name); - zval const_ALGORITHM_RANGE_PREVIEW_value; - zend_string *const_ALGORITHM_RANGE_PREVIEW_value_str = zend_string_init(MONGOC_ENCRYPT_ALGORITHM_RANGEPREVIEW, strlen(MONGOC_ENCRYPT_ALGORITHM_RANGEPREVIEW), 1); - ZVAL_STR(&const_ALGORITHM_RANGE_PREVIEW_value, const_ALGORITHM_RANGE_PREVIEW_value_str); - zend_string *const_ALGORITHM_RANGE_PREVIEW_name = zend_string_init_interned("ALGORITHM_RANGE_PREVIEW", sizeof("ALGORITHM_RANGE_PREVIEW") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_ALGORITHM_RANGE_PREVIEW_name, &const_ALGORITHM_RANGE_PREVIEW_value, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED, NULL); - zend_string_release(const_ALGORITHM_RANGE_PREVIEW_name); - zval const_QUERY_TYPE_EQUALITY_value; zend_string *const_QUERY_TYPE_EQUALITY_value_str = zend_string_init(MONGOC_ENCRYPT_QUERY_TYPE_EQUALITY, strlen(MONGOC_ENCRYPT_QUERY_TYPE_EQUALITY), 1); ZVAL_STR(&const_QUERY_TYPE_EQUALITY_value, const_QUERY_TYPE_EQUALITY_value_str); @@ -146,12 +139,5 @@ static zend_class_entry *register_class_MongoDB_Driver_ClientEncryption(void) zend_declare_class_constant_ex(class_entry, const_QUERY_TYPE_RANGE_name, &const_QUERY_TYPE_RANGE_value, ZEND_ACC_PUBLIC, NULL); zend_string_release(const_QUERY_TYPE_RANGE_name); - zval const_QUERY_TYPE_RANGE_PREVIEW_value; - zend_string *const_QUERY_TYPE_RANGE_PREVIEW_value_str = zend_string_init(MONGOC_ENCRYPT_QUERY_TYPE_RANGEPREVIEW, strlen(MONGOC_ENCRYPT_QUERY_TYPE_RANGEPREVIEW), 1); - ZVAL_STR(&const_QUERY_TYPE_RANGE_PREVIEW_value, const_QUERY_TYPE_RANGE_PREVIEW_value_str); - zend_string *const_QUERY_TYPE_RANGE_PREVIEW_name = zend_string_init_interned("QUERY_TYPE_RANGE_PREVIEW", sizeof("QUERY_TYPE_RANGE_PREVIEW") - 1, 1); - zend_declare_class_constant_ex(class_entry, const_QUERY_TYPE_RANGE_PREVIEW_name, &const_QUERY_TYPE_RANGE_PREVIEW_value, ZEND_ACC_PUBLIC|ZEND_ACC_DEPRECATED, NULL); - zend_string_release(const_QUERY_TYPE_RANGE_PREVIEW_name); - return class_entry; } diff --git a/tests/clientEncryption/clientEncryption-constants.phpt b/tests/clientEncryption/clientEncryption-constants.phpt index cdbaba805..cdb4a4eda 100644 --- a/tests/clientEncryption/clientEncryption-constants.phpt +++ b/tests/clientEncryption/clientEncryption-constants.phpt @@ -8,10 +8,8 @@ var_dump(MongoDB\Driver\ClientEncryption::AEAD_AES_256_CBC_HMAC_SHA_512_RANDOM); var_dump(MongoDB\Driver\ClientEncryption::ALGORITHM_INDEXED); var_dump(MongoDB\Driver\ClientEncryption::ALGORITHM_UNINDEXED); var_dump(MongoDB\Driver\ClientEncryption::ALGORITHM_RANGE); -var_dump(MongoDB\Driver\ClientEncryption::ALGORITHM_RANGE_PREVIEW); var_dump(MongoDB\Driver\ClientEncryption::QUERY_TYPE_EQUALITY); var_dump(MongoDB\Driver\ClientEncryption::QUERY_TYPE_RANGE); -var_dump(MongoDB\Driver\ClientEncryption::QUERY_TYPE_RANGE_PREVIEW); ?> ===DONE=== @@ -22,8 +20,6 @@ string(36) "AEAD_AES_256_CBC_HMAC_SHA_512-Random" string(7) "Indexed" string(9) "Unindexed" string(5) "Range" -%Astring(12) "RangePreview" string(8) "equality" string(5) "range" -%Astring(12) "rangePreview" ===DONE===