Skip to content

PHPC-1000: Allow bsonSerialize to return BSON structure #1449

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Aug 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/BSON/Document.c
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ static HashTable* php_phongo_document_get_properties(phongo_compat_object_handle

void php_phongo_document_init_ce(INIT_FUNC_ARGS)
{
php_phongo_document_ce = register_class_MongoDB_BSON_Document(zend_ce_aggregate, zend_ce_serializable);
php_phongo_document_ce = register_class_MongoDB_BSON_Document(zend_ce_aggregate, zend_ce_serializable, php_phongo_type_ce);
php_phongo_document_ce->create_object = php_phongo_document_create_object;

#if PHP_VERSION_ID >= 80000
Expand Down
2 changes: 1 addition & 1 deletion src/BSON/Document.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace MongoDB\BSON;

final class Document implements \IteratorAggregate, \Serializable
final class Document implements \IteratorAggregate, \Serializable, Type
{
private function __construct() {}

Expand Down
6 changes: 3 additions & 3 deletions src/BSON/Document_arginfo.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: e00ccf66afed0f51040527ee5ee24513f0c1f495 */
* Stub hash: 703e15f17b01dd2b6f04cb89c080ba83a5a420d0 */

ZEND_BEGIN_ARG_INFO_EX(arginfo_class_MongoDB_BSON_Document___construct, 0, 0, 0)
ZEND_END_ARG_INFO()
Expand Down Expand Up @@ -166,14 +166,14 @@ static const zend_function_entry class_MongoDB_BSON_Document_methods[] = {
ZEND_FE_END
};

static zend_class_entry *register_class_MongoDB_BSON_Document(zend_class_entry *class_entry_IteratorAggregate, zend_class_entry *class_entry_Serializable)
static zend_class_entry *register_class_MongoDB_BSON_Document(zend_class_entry *class_entry_IteratorAggregate, zend_class_entry *class_entry_Serializable, zend_class_entry *class_entry_MongoDB_BSON_Type)
{
zend_class_entry ce, *class_entry;

INIT_NS_CLASS_ENTRY(ce, "MongoDB\\BSON", "Document", class_MongoDB_BSON_Document_methods);
class_entry = zend_register_internal_class_ex(&ce, NULL);
class_entry->ce_flags |= ZEND_ACC_FINAL;
zend_class_implements(class_entry, 2, class_entry_IteratorAggregate, class_entry_Serializable);
zend_class_implements(class_entry, 3, class_entry_IteratorAggregate, class_entry_Serializable, class_entry_MongoDB_BSON_Type);

return class_entry;
}
2 changes: 1 addition & 1 deletion src/BSON/PackedArray.c
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ static HashTable* php_phongo_packedarray_get_properties(phongo_compat_object_han

void php_phongo_packedarray_init_ce(INIT_FUNC_ARGS)
{
php_phongo_packedarray_ce = register_class_MongoDB_BSON_PackedArray(zend_ce_aggregate, zend_ce_serializable);
php_phongo_packedarray_ce = register_class_MongoDB_BSON_PackedArray(zend_ce_aggregate, zend_ce_serializable, php_phongo_type_ce);
php_phongo_packedarray_ce->create_object = php_phongo_packedarray_create_object;

#if PHP_VERSION_ID >= 80000
Expand Down
2 changes: 1 addition & 1 deletion src/BSON/PackedArray.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace MongoDB\BSON;

final class PackedArray implements \IteratorAggregate, \Serializable
final class PackedArray implements \IteratorAggregate, \Serializable, Type
{
private function __construct() {}

Expand Down
6 changes: 3 additions & 3 deletions src/BSON/PackedArray_arginfo.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: e9b57c4051440170531560cc355e0af1b43f3424 */
* Stub hash: f9813432d7811e068f62a4b34d86919a52f63984 */

ZEND_BEGIN_ARG_INFO_EX(arginfo_class_MongoDB_BSON_PackedArray___construct, 0, 0, 0)
ZEND_END_ARG_INFO()
Expand Down Expand Up @@ -128,14 +128,14 @@ static const zend_function_entry class_MongoDB_BSON_PackedArray_methods[] = {
ZEND_FE_END
};

static zend_class_entry *register_class_MongoDB_BSON_PackedArray(zend_class_entry *class_entry_IteratorAggregate, zend_class_entry *class_entry_Serializable)
static zend_class_entry *register_class_MongoDB_BSON_PackedArray(zend_class_entry *class_entry_IteratorAggregate, zend_class_entry *class_entry_Serializable, zend_class_entry *class_entry_MongoDB_BSON_Type)
{
zend_class_entry ce, *class_entry;

INIT_NS_CLASS_ENTRY(ce, "MongoDB\\BSON", "PackedArray", class_MongoDB_BSON_PackedArray_methods);
class_entry = zend_register_internal_class_ex(&ce, NULL);
class_entry->ce_flags |= ZEND_ACC_FINAL;
zend_class_implements(class_entry, 2, class_entry_IteratorAggregate, class_entry_Serializable);
zend_class_implements(class_entry, 3, class_entry_IteratorAggregate, class_entry_Serializable, class_entry_MongoDB_BSON_Type);

return class_entry;
}
7 changes: 7 additions & 0 deletions src/BSON/Persistable.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,11 @@

interface Persistable extends Serializable, Unserializable
{
#if PHP_VERSION_ID >= 80000
/** @tentative-return-type */
public function bsonSerialize(): array|\stdClass|Document;
#else
/** @return array|\stdClass|Document */
public function bsonSerialize();
#endif
}
22 changes: 21 additions & 1 deletion src/BSON/Persistable_arginfo.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,30 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: babd07f95f47c3b66228ef23b66ab0446cd5c308 */
* Stub hash: e61c06a90093af5468c6c29f6cbf16c5db8d54d1 */

#if PHP_VERSION_ID >= 80000
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_MongoDB_BSON_Persistable_bsonSerialize, 0, 0, stdClass|MongoDB\\BSON\\Document, MAY_BE_ARRAY)
ZEND_END_ARG_INFO()
#endif

#if !(PHP_VERSION_ID >= 80000)
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_MongoDB_BSON_Persistable_bsonSerialize, 0, 0, 0)
ZEND_END_ARG_INFO()
#endif


#if PHP_VERSION_ID >= 80000
#endif
#if !(PHP_VERSION_ID >= 80000)
#endif


static const zend_function_entry class_MongoDB_BSON_Persistable_methods[] = {
#if PHP_VERSION_ID >= 80000
ZEND_ABSTRACT_ME_WITH_FLAGS(MongoDB_BSON_Persistable, bsonSerialize, arginfo_class_MongoDB_BSON_Persistable_bsonSerialize, ZEND_ACC_PUBLIC|ZEND_ACC_ABSTRACT)
#endif
#if !(PHP_VERSION_ID >= 80000)
ZEND_ABSTRACT_ME_WITH_FLAGS(MongoDB_BSON_Persistable, bsonSerialize, arginfo_class_MongoDB_BSON_Persistable_bsonSerialize, ZEND_ACC_PUBLIC|ZEND_ACC_ABSTRACT)
#endif
ZEND_FE_END
};

Expand Down
4 changes: 2 additions & 2 deletions src/BSON/Serializable.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ interface Serializable extends Type
{
#if PHP_VERSION_ID >= 80000
/** @tentative-return-type */
public function bsonSerialize(): array|object;
public function bsonSerialize(): array|\stdClass|Document|PackedArray;
#else
/** @return array|object */
/** @return array|\stdClass|Document|PackedArray */
public function bsonSerialize();
#endif
}
4 changes: 2 additions & 2 deletions src/BSON/Serializable_arginfo.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: cbb517e1d922625ff18bdc81620686a44a87e85c */
* Stub hash: 92732bafa65af8a12b291f7bcb52b069c45724a7 */

#if PHP_VERSION_ID >= 80000
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_MASK_EX(arginfo_class_MongoDB_BSON_Serializable_bsonSerialize, 0, 0, MAY_BE_ARRAY|MAY_BE_OBJECT)
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_OBJ_TYPE_MASK_EX(arginfo_class_MongoDB_BSON_Serializable_bsonSerialize, 0, 0, stdClass|MongoDB\\BSON\\Document|MongoDB\\BSON\\PackedArray, MAY_BE_ARRAY)
ZEND_END_ARG_INFO()
#endif

Expand Down
7 changes: 1 addition & 6 deletions src/MongoDB/ReadConcern.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,7 @@ final public function isDefault(): bool {}

final public static function __set_state(array $properties): ReadConcern {}

#if PHP_VERSION_ID >= 80000
final public function bsonSerialize(): array|object {}
#else
/** @return array|object */
final public function bsonSerialize() {}
#endif
final public function bsonSerialize(): \stdClass {}

final public function serialize(): string {}

Expand Down
21 changes: 2 additions & 19 deletions src/MongoDB/ReadConcern_arginfo.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: cc214d2fd99e6191747053214210d07da48831a7 */
* Stub hash: da6e980fbfe2102334158e3018b827e0bb0a9ec3 */

ZEND_BEGIN_ARG_INFO_EX(arginfo_class_MongoDB_Driver_ReadConcern___construct, 0, 0, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, level, IS_STRING, 1, "null")
Expand All @@ -15,15 +15,8 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_MongoDB_Driver_ReadConcern_
ZEND_ARG_TYPE_INFO(0, properties, IS_ARRAY, 0)
ZEND_END_ARG_INFO()

#if PHP_VERSION_ID >= 80000
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_class_MongoDB_Driver_ReadConcern_bsonSerialize, 0, 0, MAY_BE_ARRAY|MAY_BE_OBJECT)
ZEND_END_ARG_INFO()
#endif

#if !(PHP_VERSION_ID >= 80000)
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_MongoDB_Driver_ReadConcern_bsonSerialize, 0, 0, 0)
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_MongoDB_Driver_ReadConcern_bsonSerialize, 0, 0, stdClass, 0)
ZEND_END_ARG_INFO()
#endif

ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_MongoDB_Driver_ReadConcern_serialize, 0, 0, IS_STRING, 0)
ZEND_END_ARG_INFO()
Expand Down Expand Up @@ -52,12 +45,7 @@ static ZEND_METHOD(MongoDB_Driver_ReadConcern, __construct);
static ZEND_METHOD(MongoDB_Driver_ReadConcern, getLevel);
static ZEND_METHOD(MongoDB_Driver_ReadConcern, isDefault);
static ZEND_METHOD(MongoDB_Driver_ReadConcern, __set_state);
#if PHP_VERSION_ID >= 80000
static ZEND_METHOD(MongoDB_Driver_ReadConcern, bsonSerialize);
#endif
#if !(PHP_VERSION_ID >= 80000)
static ZEND_METHOD(MongoDB_Driver_ReadConcern, bsonSerialize);
#endif
static ZEND_METHOD(MongoDB_Driver_ReadConcern, serialize);
#if PHP_VERSION_ID >= 80000
static ZEND_METHOD(MongoDB_Driver_ReadConcern, unserialize);
Expand All @@ -74,12 +62,7 @@ static const zend_function_entry class_MongoDB_Driver_ReadConcern_methods[] = {
ZEND_ME(MongoDB_Driver_ReadConcern, getLevel, arginfo_class_MongoDB_Driver_ReadConcern_getLevel, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
ZEND_ME(MongoDB_Driver_ReadConcern, isDefault, arginfo_class_MongoDB_Driver_ReadConcern_isDefault, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
ZEND_ME(MongoDB_Driver_ReadConcern, __set_state, arginfo_class_MongoDB_Driver_ReadConcern___set_state, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC|ZEND_ACC_FINAL)
#if PHP_VERSION_ID >= 80000
ZEND_ME(MongoDB_Driver_ReadConcern, bsonSerialize, arginfo_class_MongoDB_Driver_ReadConcern_bsonSerialize, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
#endif
#if !(PHP_VERSION_ID >= 80000)
ZEND_ME(MongoDB_Driver_ReadConcern, bsonSerialize, arginfo_class_MongoDB_Driver_ReadConcern_bsonSerialize, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
#endif
ZEND_ME(MongoDB_Driver_ReadConcern, serialize, arginfo_class_MongoDB_Driver_ReadConcern_serialize, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
#if PHP_VERSION_ID >= 80000
ZEND_ME(MongoDB_Driver_ReadConcern, unserialize, arginfo_class_MongoDB_Driver_ReadConcern_unserialize, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
Expand Down
7 changes: 1 addition & 6 deletions src/MongoDB/ReadPreference.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,7 @@ final public function getTagSets(): array {}

final public static function __set_state(array $properties): ReadPreference {}

#if PHP_VERSION_ID >= 80000
final public function bsonSerialize(): array|object {}
#else
/** @return array|object */
final public function bsonSerialize() {}
#endif
final public function bsonSerialize(): \stdClass {}

final public function serialize(): string {}

Expand Down
21 changes: 2 additions & 19 deletions src/MongoDB/ReadPreference_arginfo.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: df8b13e252c05cbb7603dec8c1659fb88845ed73 */
* Stub hash: 1a1a31ef5910ddfbe66ba6c350df216ffe25b5dd */

#if PHP_VERSION_ID >= 80000
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_MongoDB_Driver_ReadPreference___construct, 0, 0, 1)
Expand Down Expand Up @@ -35,15 +35,8 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_MongoDB_Driver_ReadPreferen
ZEND_ARG_TYPE_INFO(0, properties, IS_ARRAY, 0)
ZEND_END_ARG_INFO()

#if PHP_VERSION_ID >= 80000
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_class_MongoDB_Driver_ReadPreference_bsonSerialize, 0, 0, MAY_BE_ARRAY|MAY_BE_OBJECT)
ZEND_END_ARG_INFO()
#endif

#if !(PHP_VERSION_ID >= 80000)
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_MongoDB_Driver_ReadPreference_bsonSerialize, 0, 0, 0)
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_MongoDB_Driver_ReadPreference_bsonSerialize, 0, 0, stdClass, 0)
ZEND_END_ARG_INFO()
#endif

#define arginfo_class_MongoDB_Driver_ReadPreference_serialize arginfo_class_MongoDB_Driver_ReadPreference_getModeString

Expand Down Expand Up @@ -78,12 +71,7 @@ static ZEND_METHOD(MongoDB_Driver_ReadPreference, getMode);
static ZEND_METHOD(MongoDB_Driver_ReadPreference, getModeString);
static ZEND_METHOD(MongoDB_Driver_ReadPreference, getTagSets);
static ZEND_METHOD(MongoDB_Driver_ReadPreference, __set_state);
#if PHP_VERSION_ID >= 80000
static ZEND_METHOD(MongoDB_Driver_ReadPreference, bsonSerialize);
#endif
#if !(PHP_VERSION_ID >= 80000)
static ZEND_METHOD(MongoDB_Driver_ReadPreference, bsonSerialize);
#endif
static ZEND_METHOD(MongoDB_Driver_ReadPreference, serialize);
#if PHP_VERSION_ID >= 80000
static ZEND_METHOD(MongoDB_Driver_ReadPreference, unserialize);
Expand All @@ -108,12 +96,7 @@ static const zend_function_entry class_MongoDB_Driver_ReadPreference_methods[] =
ZEND_ME(MongoDB_Driver_ReadPreference, getModeString, arginfo_class_MongoDB_Driver_ReadPreference_getModeString, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
ZEND_ME(MongoDB_Driver_ReadPreference, getTagSets, arginfo_class_MongoDB_Driver_ReadPreference_getTagSets, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
ZEND_ME(MongoDB_Driver_ReadPreference, __set_state, arginfo_class_MongoDB_Driver_ReadPreference___set_state, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC|ZEND_ACC_FINAL)
#if PHP_VERSION_ID >= 80000
ZEND_ME(MongoDB_Driver_ReadPreference, bsonSerialize, arginfo_class_MongoDB_Driver_ReadPreference_bsonSerialize, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
#endif
#if !(PHP_VERSION_ID >= 80000)
ZEND_ME(MongoDB_Driver_ReadPreference, bsonSerialize, arginfo_class_MongoDB_Driver_ReadPreference_bsonSerialize, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
#endif
ZEND_ME(MongoDB_Driver_ReadPreference, serialize, arginfo_class_MongoDB_Driver_ReadPreference_serialize, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
#if PHP_VERSION_ID >= 80000
ZEND_ME(MongoDB_Driver_ReadPreference, unserialize, arginfo_class_MongoDB_Driver_ReadPreference_unserialize, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
Expand Down
7 changes: 1 addition & 6 deletions src/MongoDB/ServerApi.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,7 @@ final public function __construct(string $version, ?bool $strict = null, ?bool $

final public static function __set_state(array $properties): ServerApi {}

#if PHP_VERSION_ID >= 80000
final public function bsonSerialize(): array|object {}
#else
/** @return array|object */
final public function bsonSerialize() {}
#endif
final public function bsonSerialize(): \stdClass {}

final public function serialize(): string {}

Expand Down
21 changes: 2 additions & 19 deletions src/MongoDB/ServerApi_arginfo.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: 27db2a958d63eaf3ca813416bf0756c981dd013f */
* Stub hash: 7678bfacdb398a3528feb4226a5ca1b8a21b9516 */

ZEND_BEGIN_ARG_INFO_EX(arginfo_class_MongoDB_Driver_ServerApi___construct, 0, 0, 1)
ZEND_ARG_TYPE_INFO(0, version, IS_STRING, 0)
Expand All @@ -11,15 +11,8 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_MongoDB_Driver_ServerApi___
ZEND_ARG_TYPE_INFO(0, properties, IS_ARRAY, 0)
ZEND_END_ARG_INFO()

#if PHP_VERSION_ID >= 80000
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_class_MongoDB_Driver_ServerApi_bsonSerialize, 0, 0, MAY_BE_ARRAY|MAY_BE_OBJECT)
ZEND_END_ARG_INFO()
#endif

#if !(PHP_VERSION_ID >= 80000)
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_MongoDB_Driver_ServerApi_bsonSerialize, 0, 0, 0)
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_MongoDB_Driver_ServerApi_bsonSerialize, 0, 0, stdClass, 0)
ZEND_END_ARG_INFO()
#endif

ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_MongoDB_Driver_ServerApi_serialize, 0, 0, IS_STRING, 0)
ZEND_END_ARG_INFO()
Expand All @@ -46,12 +39,7 @@ ZEND_END_ARG_INFO()

static ZEND_METHOD(MongoDB_Driver_ServerApi, __construct);
static ZEND_METHOD(MongoDB_Driver_ServerApi, __set_state);
#if PHP_VERSION_ID >= 80000
static ZEND_METHOD(MongoDB_Driver_ServerApi, bsonSerialize);
#endif
#if !(PHP_VERSION_ID >= 80000)
static ZEND_METHOD(MongoDB_Driver_ServerApi, bsonSerialize);
#endif
static ZEND_METHOD(MongoDB_Driver_ServerApi, serialize);
#if PHP_VERSION_ID >= 80000
static ZEND_METHOD(MongoDB_Driver_ServerApi, unserialize);
Expand All @@ -66,12 +54,7 @@ static ZEND_METHOD(MongoDB_Driver_ServerApi, __serialize);
static const zend_function_entry class_MongoDB_Driver_ServerApi_methods[] = {
ZEND_ME(MongoDB_Driver_ServerApi, __construct, arginfo_class_MongoDB_Driver_ServerApi___construct, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
ZEND_ME(MongoDB_Driver_ServerApi, __set_state, arginfo_class_MongoDB_Driver_ServerApi___set_state, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC|ZEND_ACC_FINAL)
#if PHP_VERSION_ID >= 80000
ZEND_ME(MongoDB_Driver_ServerApi, bsonSerialize, arginfo_class_MongoDB_Driver_ServerApi_bsonSerialize, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
#endif
#if !(PHP_VERSION_ID >= 80000)
ZEND_ME(MongoDB_Driver_ServerApi, bsonSerialize, arginfo_class_MongoDB_Driver_ServerApi_bsonSerialize, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
#endif
ZEND_ME(MongoDB_Driver_ServerApi, serialize, arginfo_class_MongoDB_Driver_ServerApi_serialize, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
#if PHP_VERSION_ID >= 80000
ZEND_ME(MongoDB_Driver_ServerApi, unserialize, arginfo_class_MongoDB_Driver_ServerApi_unserialize, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
Expand Down
7 changes: 1 addition & 6 deletions src/MongoDB/WriteConcern.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,7 @@ final public function isDefault(): bool {}

final public static function __set_state(array $properties): WriteConcern {}

#if PHP_VERSION_ID >= 80000
final public function bsonSerialize(): array|object {}
#else
/** @return array|object */
final public function bsonSerialize() {}
#endif
final public function bsonSerialize(): \stdClass {}

final public function serialize(): string {}

Expand Down
Loading