Skip to content

Commit 9ad8571

Browse files
committed
Use conditional for union types in rewrapManyDataKey
1 parent cdbefae commit 9ad8571

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

src/MongoDB/ClientEncryption.stub.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,12 @@ final public function getKeys(): \MongoDB\Driver\Cursor {}
6969

7070
final public function removeKeyAltName(\MongoDB\BSON\Binary $keyId, string $keyAltName): ?object {}
7171

72+
#if PHP_VERSION_ID >= 80000
7273
final public function rewrapManyDataKey(array|object $filter, array $options = []): object {}
74+
#else
75+
/** @param array|object $filter */
76+
final public function rewrapManyDataKey($filter, array $options = []): object {}
77+
#endif
7378

7479
final public function __wakeup(): void {}
7580
}

src/MongoDB/ClientEncryption_arginfo.h

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: 8a6eece2c09efd48a988f3acee25a1e0e9016298 */
2+
* Stub hash: 9b64f6db2b6c568fb134f8512968262b25ab0e78 */
33

44
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_MongoDB_Driver_ClientEncryption___construct, 0, 0, 1)
55
ZEND_ARG_TYPE_INFO(0, options, IS_ARRAY, 0)
@@ -58,10 +58,19 @@ ZEND_END_ARG_INFO()
5858

5959
#define arginfo_class_MongoDB_Driver_ClientEncryption_removeKeyAltName arginfo_class_MongoDB_Driver_ClientEncryption_addKeyAltName
6060

61+
#if PHP_VERSION_ID >= 80000
6162
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_MongoDB_Driver_ClientEncryption_rewrapManyDataKey, 0, 1, IS_OBJECT, 0)
6263
ZEND_ARG_TYPE_MASK(0, filter, MAY_BE_ARRAY|MAY_BE_OBJECT, NULL)
6364
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 0, "[]")
6465
ZEND_END_ARG_INFO()
66+
#endif
67+
68+
#if !(PHP_VERSION_ID >= 80000)
69+
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_MongoDB_Driver_ClientEncryption_rewrapManyDataKey, 0, 1, IS_OBJECT, 0)
70+
ZEND_ARG_INFO(0, filter)
71+
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 0, "[]")
72+
ZEND_END_ARG_INFO()
73+
#endif
6574

6675
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_MongoDB_Driver_ClientEncryption___wakeup, 0, 0, IS_VOID, 0)
6776
ZEND_END_ARG_INFO()
@@ -87,7 +96,12 @@ static ZEND_METHOD(MongoDB_Driver_ClientEncryption, getKey);
8796
static ZEND_METHOD(MongoDB_Driver_ClientEncryption, getKeyByAltName);
8897
static ZEND_METHOD(MongoDB_Driver_ClientEncryption, getKeys);
8998
static ZEND_METHOD(MongoDB_Driver_ClientEncryption, removeKeyAltName);
99+
#if PHP_VERSION_ID >= 80000
90100
static ZEND_METHOD(MongoDB_Driver_ClientEncryption, rewrapManyDataKey);
101+
#endif
102+
#if !(PHP_VERSION_ID >= 80000)
103+
static ZEND_METHOD(MongoDB_Driver_ClientEncryption, rewrapManyDataKey);
104+
#endif
91105
static ZEND_METHOD(MongoDB_Driver_ClientEncryption, __wakeup);
92106

93107

@@ -112,7 +126,12 @@ static const zend_function_entry class_MongoDB_Driver_ClientEncryption_methods[]
112126
ZEND_ME(MongoDB_Driver_ClientEncryption, getKeyByAltName, arginfo_class_MongoDB_Driver_ClientEncryption_getKeyByAltName, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
113127
ZEND_ME(MongoDB_Driver_ClientEncryption, getKeys, arginfo_class_MongoDB_Driver_ClientEncryption_getKeys, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
114128
ZEND_ME(MongoDB_Driver_ClientEncryption, removeKeyAltName, arginfo_class_MongoDB_Driver_ClientEncryption_removeKeyAltName, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
129+
#if PHP_VERSION_ID >= 80000
115130
ZEND_ME(MongoDB_Driver_ClientEncryption, rewrapManyDataKey, arginfo_class_MongoDB_Driver_ClientEncryption_rewrapManyDataKey, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
131+
#endif
132+
#if !(PHP_VERSION_ID >= 80000)
133+
ZEND_ME(MongoDB_Driver_ClientEncryption, rewrapManyDataKey, arginfo_class_MongoDB_Driver_ClientEncryption_rewrapManyDataKey, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
134+
#endif
116135
ZEND_ME(MongoDB_Driver_ClientEncryption, __wakeup, arginfo_class_MongoDB_Driver_ClientEncryption___wakeup, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
117136
ZEND_FE_END
118137
};

0 commit comments

Comments
 (0)