Skip to content

Commit 49e526e

Browse files
committed
Ensure all classes with disabled serialisation declare __wakeup
1 parent f54546a commit 49e526e

14 files changed

+49
-6
lines changed

src/MongoDB/BulkWrite.stub.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,6 @@ public function update(array|object $filter, array|object $newObj, array $update
3939
*/
4040
public function update($filter, $newObj, array $updateOptions = []): void {}
4141
#endif
42+
43+
final public function __wakeup(): void {}
4244
}

src/MongoDB/BulkWrite_arginfo.h

Lines changed: 6 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: ccb88a8730d28fed822df1f0585988886dd806cb */
2+
* Stub hash: 3325b767b4321a1837fa7a8aef924a39e6e6816d */
33

44
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_MongoDB_Driver_BulkWrite___construct, 0, 0, 0)
55
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, options, IS_ARRAY, 0, "[]")
@@ -50,6 +50,9 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_MongoDB_Driver_BulkWrite_u
5050
ZEND_END_ARG_INFO()
5151
#endif
5252

53+
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_MongoDB_Driver_BulkWrite___wakeup, 0, 0, IS_VOID, 0)
54+
ZEND_END_ARG_INFO()
55+
5356

5457
static ZEND_METHOD(MongoDB_Driver_BulkWrite, __construct);
5558
static ZEND_METHOD(MongoDB_Driver_BulkWrite, count);
@@ -71,6 +74,7 @@ static ZEND_METHOD(MongoDB_Driver_BulkWrite, update);
7174
#if !(PHP_VERSION_ID >= 80000)
7275
static ZEND_METHOD(MongoDB_Driver_BulkWrite, update);
7376
#endif
77+
static ZEND_METHOD(MongoDB_Driver_BulkWrite, __wakeup);
7478

7579

7680
static const zend_function_entry class_MongoDB_Driver_BulkWrite_methods[] = {
@@ -94,6 +98,7 @@ static const zend_function_entry class_MongoDB_Driver_BulkWrite_methods[] = {
9498
#if !(PHP_VERSION_ID >= 80000)
9599
ZEND_ME(MongoDB_Driver_BulkWrite, update, arginfo_class_MongoDB_Driver_BulkWrite_update, ZEND_ACC_PUBLIC)
96100
#endif
101+
ZEND_ME(MongoDB_Driver_BulkWrite, __wakeup, arginfo_class_MongoDB_Driver_BulkWrite___wakeup, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
97102
ZEND_FE_END
98103
};
99104

src/MongoDB/ClientEncryption.stub.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,6 @@ final public function encrypt(mixed $value, array $options = []): \MongoDB\BSON\
5656
/** @param mixed $value */
5757
final public function encrypt($value, array $options = []): \MongoDB\BSON\Binary {}
5858
#endif
59+
60+
final public function __wakeup(): void {}
5961
}

src/MongoDB/ClientEncryption_arginfo.h

Lines changed: 6 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: d8e3bd42058296c2e67ff7107d08694de7164fdd */
2+
* Stub hash: 169e941e986be2158c89ddba5d5f930cb8fa6bfe */
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)
@@ -36,6 +36,9 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_MongoDB_Driver_ClientEncryp
3636
ZEND_END_ARG_INFO()
3737
#endif
3838

39+
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_MongoDB_Driver_ClientEncryption___wakeup, 0, 0, IS_VOID, 0)
40+
ZEND_END_ARG_INFO()
41+
3942

4043
static ZEND_METHOD(MongoDB_Driver_ClientEncryption, __construct);
4144
static ZEND_METHOD(MongoDB_Driver_ClientEncryption, createDataKey);
@@ -51,6 +54,7 @@ static ZEND_METHOD(MongoDB_Driver_ClientEncryption, encrypt);
5154
#if !(PHP_VERSION_ID >= 80000)
5255
static ZEND_METHOD(MongoDB_Driver_ClientEncryption, encrypt);
5356
#endif
57+
static ZEND_METHOD(MongoDB_Driver_ClientEncryption, __wakeup);
5458

5559

5660
static const zend_function_entry class_MongoDB_Driver_ClientEncryption_methods[] = {
@@ -68,6 +72,7 @@ static const zend_function_entry class_MongoDB_Driver_ClientEncryption_methods[]
6872
#if !(PHP_VERSION_ID >= 80000)
6973
ZEND_ME(MongoDB_Driver_ClientEncryption, encrypt, arginfo_class_MongoDB_Driver_ClientEncryption_encrypt, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
7074
#endif
75+
ZEND_ME(MongoDB_Driver_ClientEncryption, __wakeup, arginfo_class_MongoDB_Driver_ClientEncryption___wakeup, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
7176
ZEND_FE_END
7277
};
7378

src/MongoDB/Command.stub.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,6 @@ final public function __construct(array|object $document, array $commandOptions
1515
/** @param array|object $document */
1616
final public function __construct($document, array $commandOptions = []) {}
1717
#endif
18+
19+
final public function __wakeup(): void {}
1820
}

src/MongoDB/Command_arginfo.h

Lines changed: 6 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: 7d4cd783815b6655add5530cfb6e4b085560687d */
2+
* Stub hash: 3902d0f3c6602053c90a7ee4bc97ece0d6534157 */
33

44
#if PHP_VERSION_ID >= 80000
55
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_MongoDB_Driver_Command___construct, 0, 0, 1)
@@ -15,13 +15,17 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_class_MongoDB_Driver_Command___construct, 0, 0, 1
1515
ZEND_END_ARG_INFO()
1616
#endif
1717

18+
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_MongoDB_Driver_Command___wakeup, 0, 0, IS_VOID, 0)
19+
ZEND_END_ARG_INFO()
20+
1821

1922
#if PHP_VERSION_ID >= 80000
2023
static ZEND_METHOD(MongoDB_Driver_Command, __construct);
2124
#endif
2225
#if !(PHP_VERSION_ID >= 80000)
2326
static ZEND_METHOD(MongoDB_Driver_Command, __construct);
2427
#endif
28+
static ZEND_METHOD(MongoDB_Driver_Command, __wakeup);
2529

2630

2731
static const zend_function_entry class_MongoDB_Driver_Command_methods[] = {
@@ -31,6 +35,7 @@ static const zend_function_entry class_MongoDB_Driver_Command_methods[] = {
3135
#if !(PHP_VERSION_ID >= 80000)
3236
ZEND_ME(MongoDB_Driver_Command, __construct, arginfo_class_MongoDB_Driver_Command___construct, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
3337
#endif
38+
ZEND_ME(MongoDB_Driver_Command, __wakeup, arginfo_class_MongoDB_Driver_Command___wakeup, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
3439
ZEND_FE_END
3540
};
3641

src/MongoDB/Cursor.stub.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,6 @@ final public function setTypeMap(array $typemap): void {}
3535
final public function toArray(): array {}
3636

3737
public function valid(): bool {}
38+
39+
final public function __wakeup(): void {}
3840
}

src/MongoDB/Cursor_arginfo.h

Lines changed: 5 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: b94c509926df512855559d2c0ab4263b9d7dec63 */
2+
* Stub hash: 2cbb89ebb247f650b26458f40f3cdc196cff386b */
33

44
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_MongoDB_Driver_Cursor___construct, 0, 0, 0)
55
ZEND_END_ARG_INFO()
@@ -40,6 +40,8 @@ ZEND_END_ARG_INFO()
4040

4141
#define arginfo_class_MongoDB_Driver_Cursor_valid arginfo_class_MongoDB_Driver_Cursor_isDead
4242

43+
#define arginfo_class_MongoDB_Driver_Cursor___wakeup arginfo_class_MongoDB_Driver_Cursor_next
44+
4345

4446
static ZEND_METHOD(MongoDB_Driver_Cursor, __construct);
4547
#if PHP_VERSION_ID >= 80000
@@ -57,6 +59,7 @@ static ZEND_METHOD(MongoDB_Driver_Cursor, rewind);
5759
static ZEND_METHOD(MongoDB_Driver_Cursor, setTypeMap);
5860
static ZEND_METHOD(MongoDB_Driver_Cursor, toArray);
5961
static ZEND_METHOD(MongoDB_Driver_Cursor, valid);
62+
static ZEND_METHOD(MongoDB_Driver_Cursor, __wakeup);
6063

6164

6265
static const zend_function_entry class_MongoDB_Driver_Cursor_methods[] = {
@@ -76,6 +79,7 @@ static const zend_function_entry class_MongoDB_Driver_Cursor_methods[] = {
7679
ZEND_ME(MongoDB_Driver_Cursor, setTypeMap, arginfo_class_MongoDB_Driver_Cursor_setTypeMap, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
7780
ZEND_ME(MongoDB_Driver_Cursor, toArray, arginfo_class_MongoDB_Driver_Cursor_toArray, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
7881
ZEND_ME(MongoDB_Driver_Cursor, valid, arginfo_class_MongoDB_Driver_Cursor_valid, ZEND_ACC_PUBLIC)
82+
ZEND_ME(MongoDB_Driver_Cursor, __wakeup, arginfo_class_MongoDB_Driver_Cursor___wakeup, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
7983
ZEND_FE_END
8084
};
8185

src/MongoDB/ServerDescription.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ php_phongo_server_description_type_map_t
4545
};
4646

4747
PHONGO_DISABLED_CONSTRUCTOR(MongoDB_Driver_ServerDescription)
48+
PHONGO_DISABLED_WAKEUP(MongoDB_Driver_ServerDescription)
4849

4950
/* {{{ proto array MongoDB\Driver\ServerDescription::getHelloResponse()
5051
Returns the most recent "hello" response */

src/MongoDB/ServerDescription.stub.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,4 +82,6 @@ final public function getPort(): int {}
8282
final public function getRoundTripTime(): ?int {}
8383

8484
final public function getType(): string {}
85+
86+
final public function __wakeup(): void {}
8587
}

src/MongoDB/ServerDescription_arginfo.h

Lines changed: 6 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: 85cce1e6824dec5cb0d659b841d893a849948eeb */
2+
* Stub hash: f08f0c45a9719ff708a03b5470cb6b0822f8f908 */
33

44
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_MongoDB_Driver_ServerDescription___construct, 0, 0, 0)
55
ZEND_END_ARG_INFO()
@@ -20,6 +20,9 @@ ZEND_END_ARG_INFO()
2020

2121
#define arginfo_class_MongoDB_Driver_ServerDescription_getType arginfo_class_MongoDB_Driver_ServerDescription_getHost
2222

23+
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_MongoDB_Driver_ServerDescription___wakeup, 0, 0, IS_VOID, 0)
24+
ZEND_END_ARG_INFO()
25+
2326

2427
static ZEND_METHOD(MongoDB_Driver_ServerDescription, __construct);
2528
static ZEND_METHOD(MongoDB_Driver_ServerDescription, getHelloResponse);
@@ -28,6 +31,7 @@ static ZEND_METHOD(MongoDB_Driver_ServerDescription, getLastUpdateTime);
2831
static ZEND_METHOD(MongoDB_Driver_ServerDescription, getPort);
2932
static ZEND_METHOD(MongoDB_Driver_ServerDescription, getRoundTripTime);
3033
static ZEND_METHOD(MongoDB_Driver_ServerDescription, getType);
34+
static ZEND_METHOD(MongoDB_Driver_ServerDescription, __wakeup);
3135

3236

3337
static const zend_function_entry class_MongoDB_Driver_ServerDescription_methods[] = {
@@ -38,6 +42,7 @@ static const zend_function_entry class_MongoDB_Driver_ServerDescription_methods[
3842
ZEND_ME(MongoDB_Driver_ServerDescription, getPort, arginfo_class_MongoDB_Driver_ServerDescription_getPort, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
3943
ZEND_ME(MongoDB_Driver_ServerDescription, getRoundTripTime, arginfo_class_MongoDB_Driver_ServerDescription_getRoundTripTime, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
4044
ZEND_ME(MongoDB_Driver_ServerDescription, getType, arginfo_class_MongoDB_Driver_ServerDescription_getType, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
45+
ZEND_ME(MongoDB_Driver_ServerDescription, __wakeup, arginfo_class_MongoDB_Driver_ServerDescription___wakeup, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
4146
ZEND_FE_END
4247
};
4348

src/MongoDB/TopologyDescription.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
zend_class_entry* php_phongo_topologydescription_ce;
3333

3434
PHONGO_DISABLED_CONSTRUCTOR(MongoDB_Driver_TopologyDescription)
35+
PHONGO_DISABLED_WAKEUP(MongoDB_Driver_TopologyDescription)
3536

3637
/* {{{ proto array MongoDB\Driver\TopologyDescription::getServers()
3738
Returns an array of ServerDescription objects for all known servers in the topology */

src/MongoDB/TopologyDescription.stub.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,6 @@ final public function getType(): string {}
5454
final public function hasReadableServer(?ReadPreference $readPreference = null): bool {}
5555

5656
final public function hasWritableServer(): bool {}
57+
58+
final public function __wakeup(): void {}
5759
}

src/MongoDB/TopologyDescription_arginfo.h

Lines changed: 6 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: 7c61addf17e525496c8755d437b4db423f6be59d */
2+
* Stub hash: 6981655ece74ddf6f2cac7e5704c5f764bb0a2ef */
33

44
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_MongoDB_Driver_TopologyDescription___construct, 0, 0, 0)
55
ZEND_END_ARG_INFO()
@@ -17,12 +17,16 @@ ZEND_END_ARG_INFO()
1717
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_MongoDB_Driver_TopologyDescription_hasWritableServer, 0, 0, _IS_BOOL, 0)
1818
ZEND_END_ARG_INFO()
1919

20+
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_MongoDB_Driver_TopologyDescription___wakeup, 0, 0, IS_VOID, 0)
21+
ZEND_END_ARG_INFO()
22+
2023

2124
static ZEND_METHOD(MongoDB_Driver_TopologyDescription, __construct);
2225
static ZEND_METHOD(MongoDB_Driver_TopologyDescription, getServers);
2326
static ZEND_METHOD(MongoDB_Driver_TopologyDescription, getType);
2427
static ZEND_METHOD(MongoDB_Driver_TopologyDescription, hasReadableServer);
2528
static ZEND_METHOD(MongoDB_Driver_TopologyDescription, hasWritableServer);
29+
static ZEND_METHOD(MongoDB_Driver_TopologyDescription, __wakeup);
2630

2731

2832
static const zend_function_entry class_MongoDB_Driver_TopologyDescription_methods[] = {
@@ -31,6 +35,7 @@ static const zend_function_entry class_MongoDB_Driver_TopologyDescription_method
3135
ZEND_ME(MongoDB_Driver_TopologyDescription, getType, arginfo_class_MongoDB_Driver_TopologyDescription_getType, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
3236
ZEND_ME(MongoDB_Driver_TopologyDescription, hasReadableServer, arginfo_class_MongoDB_Driver_TopologyDescription_hasReadableServer, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
3337
ZEND_ME(MongoDB_Driver_TopologyDescription, hasWritableServer, arginfo_class_MongoDB_Driver_TopologyDescription_hasWritableServer, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
38+
ZEND_ME(MongoDB_Driver_TopologyDescription, __wakeup, arginfo_class_MongoDB_Driver_TopologyDescription___wakeup, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
3439
ZEND_FE_END
3540
};
3641

0 commit comments

Comments
 (0)