Skip to content

PHPC-2206: Implement BSON\Value class #1412

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 44 commits into from
Jun 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
6a480eb
First implementation for MongoDB\BSON\Value
alcaeus Apr 21, 2023
525f797
Add is* methods to MongoDB\BSON\Value
alcaeus Apr 21, 2023
9b630d5
Extract functions to create BSON instances
alcaeus Apr 21, 2023
79cfe1c
Add getters for all BSON types
alcaeus Apr 21, 2023
321ea81
Apply code review feedback
alcaeus Apr 24, 2023
5218768
Rename BSON factory functions
alcaeus Apr 24, 2023
cd3afaf
Return bool in BSON factories
alcaeus Apr 24, 2023
f9c2518
Clean up int64 compatibility macro includes
alcaeus Apr 25, 2023
cf20261
Use macro to throw unexpected BSON type exceptions
alcaeus Apr 25, 2023
dbd44ae
Extract int64 tests for BSON value
alcaeus Apr 25, 2023
f10a45a
Add error test for BSON value factory
alcaeus Apr 25, 2023
e168bc5
Implement debug output for BSON value instances
alcaeus Apr 25, 2023
b4ad655
Remove object comparison handler
alcaeus Apr 25, 2023
a1729d2
Implement tests for cloning BSON value instances
alcaeus Apr 25, 2023
facdd1b
Add tests for isInt and getInt
alcaeus Apr 25, 2023
c38f0e9
Ensure stdbool.h is included for compat macros
alcaeus Apr 25, 2023
f68a5ef
Refactor phongo_bson_value_to_zval
alcaeus Apr 25, 2023
97136dc
Refactor phongo_zval_to_bson_value
alcaeus Apr 25, 2023
80e913b
Return bson_value_t instances in BSON iterator
alcaeus Apr 25, 2023
5649936
Return bson_value_t instances in Document::get
alcaeus Apr 25, 2023
b0148c3
Return bson_value_t instances in PackedArray::get
alcaeus Apr 25, 2023
fe2dd61
Return BSON type instances in bson_value_t
alcaeus Apr 25, 2023
6bcc5a3
Remove obsolete php_phongo_bson_iter_to_zval function
alcaeus Apr 25, 2023
f6d5d30
Use PHP values in debug output
alcaeus Apr 27, 2023
e0361a3
Comprehensively test all BSON types
alcaeus Apr 27, 2023
2847fc3
Implement serialisation of BSON Value instances
alcaeus Apr 28, 2023
a5fc863
Drop isInt and getInt methods from BSON value class
alcaeus May 4, 2023
6ec050c
Always return int64 instances in Value::getInt64
alcaeus May 4, 2023
cdac54e
Update serialisation and debug info for BSON classes
alcaeus May 4, 2023
c23eacb
Create Int64 instances directly
alcaeus May 24, 2023
0b23fb8
Add comment explaining extra property in get_debug_info
alcaeus May 26, 2023
e17a012
Clarify exception message when initialising Value instance
alcaeus May 26, 2023
abc7d76
Simplify invocations of get_properties_hash with string type
alcaeus May 26, 2023
9e601ac
Handle zval conversion error in get_properties_hash
alcaeus May 26, 2023
04eb4db
Add comment noting phongo_bson_value_to_zval will throw
alcaeus May 26, 2023
5715be7
Fix zval capitalisation
alcaeus May 26, 2023
b0e22e4
Handle bson value conversion error on serialisation
alcaeus May 26, 2023
b8a9d50
Document exceptions when converting values to zval
alcaeus May 26, 2023
07e543a
Clean up unused macros
alcaeus May 26, 2023
dc8fb6e
Add missing __set_state methods
alcaeus May 26, 2023
7d8b495
Test MongoDB\BSON\Value::__set_state()
alcaeus May 26, 2023
1e8c927
Skip __set_state test on PHP 7.2
alcaeus Jun 12, 2023
6ff4c4c
Change docblock to regular comment
alcaeus Jun 15, 2023
d96bc6c
Use new BSON value conversion function when encrypting data
alcaeus Jun 15, 2023
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
1 change: 1 addition & 0 deletions config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ if test "$PHP_MONGODB" != "no"; then
src/BSON/Unserializable.c \
src/BSON/UTCDateTime.c \
src/BSON/UTCDateTimeInterface.c \
src/BSON/Value.c \
src/BSON/functions.c \
src/MongoDB/BulkWrite.c \
src/MongoDB/ClientEncryption.c \
Expand Down
2 changes: 1 addition & 1 deletion config.w32
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ if (PHP_MONGODB != "no") {

EXTENSION("mongodb", "php_phongo.c", null, PHP_MONGODB_CFLAGS);
MONGODB_ADD_SOURCES("/src", "phongo_apm.c phongo_bson.c phongo_bson_encode.c phongo_client.c phongo_compat.c phongo_error.c phongo_execute.c phongo_ini.c phongo_util.c");
MONGODB_ADD_SOURCES("/src/BSON", "Binary.c BinaryInterface.c Document.c Iterator.c DBPointer.c Decimal128.c Decimal128Interface.c Int64.c Javascript.c JavascriptInterface.c MaxKey.c MaxKeyInterface.c MinKey.c MinKeyInterface.c ObjectId.c ObjectIdInterface.c PackedArray.c Persistable.c Regex.c RegexInterface.c Serializable.c Symbol.c Timestamp.c TimestampInterface.c Type.c Undefined.c Unserializable.c UTCDateTime.c UTCDateTimeInterface.c functions.c");
MONGODB_ADD_SOURCES("/src/BSON", "Binary.c BinaryInterface.c Document.c Iterator.c DBPointer.c Decimal128.c Decimal128Interface.c Int64.c Javascript.c JavascriptInterface.c MaxKey.c MaxKeyInterface.c MinKey.c MinKeyInterface.c ObjectId.c ObjectIdInterface.c PackedArray.c Persistable.c Regex.c RegexInterface.c Serializable.c Symbol.c Timestamp.c TimestampInterface.c Type.c Undefined.c Unserializable.c UTCDateTime.c UTCDateTimeInterface.c Value.c functions.c");
MONGODB_ADD_SOURCES("/src/MongoDB", "BulkWrite.c ClientEncryption.c Command.c Cursor.c CursorId.c CursorInterface.c Manager.c Query.c ReadConcern.c ReadPreference.c Server.c ServerApi.c ServerDescription.c Session.c TopologyDescription.c WriteConcern.c WriteConcernError.c WriteError.c WriteResult.c");
MONGODB_ADD_SOURCES("/src/MongoDB/Exception", "AuthenticationException.c BulkWriteException.c CommandException.c ConnectionException.c ConnectionTimeoutException.c EncryptionException.c Exception.c ExecutionTimeoutException.c InvalidArgumentException.c LogicException.c RuntimeException.c ServerException.c SSLConnectionException.c UnexpectedValueException.c WriteException.c");
MONGODB_ADD_SOURCES("/src/MongoDB/Monitoring", "CommandFailedEvent.c CommandStartedEvent.c CommandSubscriber.c CommandSucceededEvent.c SDAMSubscriber.c Subscriber.c ServerChangedEvent.c ServerClosedEvent.c ServerHeartbeatFailedEvent.c ServerHeartbeatStartedEvent.c ServerHeartbeatSucceededEvent.c ServerOpeningEvent.c TopologyChangedEvent.c TopologyClosedEvent.c TopologyOpeningEvent.c functions.c");
Expand Down
1 change: 1 addition & 0 deletions php_phongo.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ PHP_MINIT_FUNCTION(mongodb) /* {{{ */
php_phongo_timestamp_interface_init_ce(INIT_FUNC_ARGS_PASSTHRU);
php_phongo_utcdatetime_interface_init_ce(INIT_FUNC_ARGS_PASSTHRU);

php_phongo_value_init_ce(INIT_FUNC_ARGS_PASSTHRU);
php_phongo_iterator_init_ce(INIT_FUNC_ARGS_PASSTHRU);
php_phongo_packedarray_init_ce(INIT_FUNC_ARGS_PASSTHRU);
php_phongo_document_init_ce(INIT_FUNC_ARGS_PASSTHRU);
Expand Down
14 changes: 14 additions & 0 deletions src/BSON/Binary.c
Original file line number Diff line number Diff line change
Expand Up @@ -354,3 +354,17 @@ void php_phongo_binary_init_ce(INIT_FUNC_ARGS)
php_phongo_handler_binary.free_obj = php_phongo_binary_free_object;
php_phongo_handler_binary.offset = XtOffsetOf(php_phongo_binary_t, std);
}

bool phongo_binary_new(zval* object, const char* data, size_t data_len, bson_subtype_t type)
{
php_phongo_binary_t* intern;

object_init_ex(object, php_phongo_binary_ce);

intern = Z_BINARY_OBJ_P(object);
intern->data = estrndup(data, data_len);
intern->data_len = data_len;
intern->type = (uint8_t) type;

return true;
}
2 changes: 2 additions & 0 deletions src/BSON/Binary.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,6 @@

#define PHONGO_BINARY_UUID_SIZE 16

bool phongo_binary_new(zval* object, const char* data, size_t data_len, bson_subtype_t type);

#endif /* PHONGO_BSON_BINARY_H */
32 changes: 32 additions & 0 deletions src/BSON/DBPointer.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,24 @@ static PHP_METHOD(MongoDB_BSON_DBPointer, __toString)
efree(retval);
}

static PHP_METHOD(MongoDB_BSON_DBPointer, __set_state)
{
php_phongo_dbpointer_t* intern;
HashTable* props;
zval* array;

PHONGO_PARSE_PARAMETERS_START(1, 1)
Z_PARAM_ARRAY(array)
PHONGO_PARSE_PARAMETERS_END();

object_init_ex(return_value, php_phongo_dbpointer_ce);

intern = Z_DBPOINTER_OBJ_P(return_value);
props = Z_ARRVAL_P(array);

php_phongo_dbpointer_init_from_hash(intern, props);
}

static PHP_METHOD(MongoDB_BSON_DBPointer, jsonSerialize)
{
php_phongo_dbpointer_t* intern;
Expand Down Expand Up @@ -296,3 +314,17 @@ void php_phongo_dbpointer_init_ce(INIT_FUNC_ARGS)
php_phongo_handler_dbpointer.free_obj = php_phongo_dbpointer_free_object;
php_phongo_handler_dbpointer.offset = XtOffsetOf(php_phongo_dbpointer_t, std);
}

bool phongo_dbpointer_new(zval* object, const char* ref, size_t ref_len, const bson_oid_t* oid)
{
php_phongo_dbpointer_t* intern;

object_init_ex(object, php_phongo_dbpointer_ce);

intern = Z_DBPOINTER_OBJ_P(object);
intern->ref = estrndup(ref, ref_len);
intern->ref_len = ref_len;
bson_oid_to_string(oid, intern->id);

return true;
}
22 changes: 22 additions & 0 deletions src/BSON/DBPointer.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* Copyright 2023-present MongoDB, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#ifndef PHONGO_BSON_DBPOINTER_H
#define PHONGO_BSON_DBPOINTER_H

bool phongo_dbpointer_new(zval* object, const char* ref, size_t ref_len, const bson_oid_t* oid);

#endif /* PHONGO_BSON_DBPOINTER_H */
2 changes: 2 additions & 0 deletions src/BSON/DBPointer.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ final class DBPointer implements \JsonSerializable, Type, \Serializable
{
final private function __construct() {}

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

final public function __toString(): string {}

final public function serialize(): string {}
Expand Down
8 changes: 7 additions & 1 deletion src/BSON/DBPointer_arginfo.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: 715bc228895c936eb673a93d58750c38fe83f210 */
* Stub hash: 2e26331e12fe64ef077d0d2b37433d291cb87943 */

ZEND_BEGIN_ARG_INFO_EX(arginfo_class_MongoDB_BSON_DBPointer___construct, 0, 0, 0)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_MongoDB_BSON_DBPointer___set_state, 0, 1, MongoDB\\BSON\\DBPointer, 0)
ZEND_ARG_TYPE_INFO(0, properties, IS_ARRAY, 0)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_MongoDB_BSON_DBPointer___toString, 0, 0, IS_STRING, 0)
ZEND_END_ARG_INFO()

Expand Down Expand Up @@ -32,6 +36,7 @@ ZEND_END_ARG_INFO()


static ZEND_METHOD(MongoDB_BSON_DBPointer, __construct);
static ZEND_METHOD(MongoDB_BSON_DBPointer, __set_state);
static ZEND_METHOD(MongoDB_BSON_DBPointer, __toString);
static ZEND_METHOD(MongoDB_BSON_DBPointer, serialize);
static ZEND_METHOD(MongoDB_BSON_DBPointer, unserialize);
Expand All @@ -47,6 +52,7 @@ static ZEND_METHOD(MongoDB_BSON_DBPointer, jsonSerialize);

static const zend_function_entry class_MongoDB_BSON_DBPointer_methods[] = {
ZEND_ME(MongoDB_BSON_DBPointer, __construct, arginfo_class_MongoDB_BSON_DBPointer___construct, ZEND_ACC_PRIVATE|ZEND_ACC_FINAL)
ZEND_ME(MongoDB_BSON_DBPointer, __set_state, arginfo_class_MongoDB_BSON_DBPointer___set_state, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC|ZEND_ACC_FINAL)
ZEND_ME(MongoDB_BSON_DBPointer, __toString, arginfo_class_MongoDB_BSON_DBPointer___toString, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
ZEND_ME(MongoDB_BSON_DBPointer, serialize, arginfo_class_MongoDB_BSON_DBPointer_serialize, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
ZEND_ME(MongoDB_BSON_DBPointer, unserialize, arginfo_class_MongoDB_BSON_DBPointer_unserialize, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
Expand Down
13 changes: 13 additions & 0 deletions src/BSON/Decimal128.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,3 +289,16 @@ void php_phongo_decimal128_init_ce(INIT_FUNC_ARGS)
php_phongo_handler_decimal128.free_obj = php_phongo_decimal128_free_object;
php_phongo_handler_decimal128.offset = XtOffsetOf(php_phongo_decimal128_t, std);
}

bool phongo_decimal128_new(zval* object, const bson_decimal128_t* decimal)
{
php_phongo_decimal128_t* intern;

object_init_ex(object, php_phongo_decimal128_ce);

intern = Z_DECIMAL128_OBJ_P(object);
memcpy(&intern->decimal, decimal, sizeof(bson_decimal128_t));
intern->initialized = true;

return true;
}
22 changes: 22 additions & 0 deletions src/BSON/Decimal128.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* Copyright 2023-present MongoDB, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#ifndef PHONGO_BSON_DECIMAL128_H
#define PHONGO_BSON_DECIMAL128_H

bool phongo_decimal128_new(zval* object, const bson_decimal128_t* decimal);

#endif /* PHONGO_BSON_DECIMAL128_H */
53 changes: 47 additions & 6 deletions src/BSON/Document.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include "phongo_bson_encode.h"
#include "BSON/Document_arginfo.h"
#include "BSON/Iterator.h"
#include "BSON/Value.h"

zend_class_entry* php_phongo_document_ce;

Expand Down Expand Up @@ -57,14 +58,14 @@ static bool php_phongo_document_init_from_hash(php_phongo_document_t* intern, Ha
return false;
}

static HashTable* php_phongo_document_get_properties_hash(phongo_compat_object_handler_type* object, bool is_temp)
static HashTable* php_phongo_document_get_properties_hash(phongo_compat_object_handler_type* object, bool is_temp, int size)
{
php_phongo_document_t* intern;
HashTable* props;

intern = Z_OBJ_DOCUMENT(PHONGO_COMPAT_GET_OBJ(object));

PHONGO_GET_PROPERTY_HASH_INIT_PROPS(is_temp, intern, props, 1);
PHONGO_GET_PROPERTY_HASH_INIT_PROPS(is_temp, intern, props, size);

if (!intern->bson) {
return props;
Expand Down Expand Up @@ -186,7 +187,7 @@ static PHP_METHOD(MongoDB_BSON_Document, get)
RETURN_NULL();
}

php_phongo_bson_iter_to_zval(return_value, &iter);
phongo_value_new(return_value, bson_iter_value(&iter));
}

static PHP_METHOD(MongoDB_BSON_Document, getIterator)
Expand Down Expand Up @@ -356,7 +357,7 @@ static PHP_METHOD(MongoDB_BSON_Document, __serialize)
{
PHONGO_PARSE_PARAMETERS_NONE();

RETURN_ARR(php_phongo_document_get_properties_hash(PHONGO_COMPAT_OBJ_P(getThis()), true));
RETURN_ARR(php_phongo_document_get_properties_hash(PHONGO_COMPAT_OBJ_P(getThis()), true, 1));
}

static PHP_METHOD(MongoDB_BSON_Document, __unserialize)
Expand Down Expand Up @@ -432,13 +433,41 @@ static int php_phongo_document_compare_objects(zval* o1, zval* o2)

static HashTable* php_phongo_document_get_debug_info(phongo_compat_object_handler_type* object, int* is_temp)
{
php_phongo_document_t* intern;
HashTable* props;

*is_temp = 1;
return php_phongo_document_get_properties_hash(object, true);
intern = Z_OBJ_DOCUMENT(PHONGO_COMPAT_GET_OBJ(object));

/* This get_debug_info handler reports an additional property. This does not
* conflict with other uses of php_phongo_document_get_properties_hash since
* we always allocated a new HashTable with is_temp=true. */
props = php_phongo_document_get_properties_hash(object, true, 2);

{
php_phongo_bson_state state;

PHONGO_BSON_INIT_STATE(state);
state.map.array.type = PHONGO_TYPEMAP_BSON;
state.map.document.type = PHONGO_TYPEMAP_BSON;
if (!php_phongo_bson_to_zval_ex(intern->bson, &state)) {
zval_ptr_dtor(&state.zchild);
goto failure;
}

zend_hash_str_update(props, "value", sizeof("value") - 1, &state.zchild);
}

return props;

failure:
PHONGO_GET_PROPERTY_HASH_FREE_PROPS(is_temp, props);
return NULL;
}

static HashTable* php_phongo_document_get_properties(phongo_compat_object_handler_type* object)
{
return php_phongo_document_get_properties_hash(object, false);
return php_phongo_document_get_properties_hash(object, false, 1);
}

void php_phongo_document_init_ce(INIT_FUNC_ARGS)
Expand All @@ -458,3 +487,15 @@ void php_phongo_document_init_ce(INIT_FUNC_ARGS)
php_phongo_handler_document.free_obj = php_phongo_document_free_object;
php_phongo_handler_document.offset = XtOffsetOf(php_phongo_document_t, std);
}

bool phongo_document_new(zval* object, bson_t* bson, bool copy)
{
php_phongo_document_t* intern;

object_init_ex(object, php_phongo_document_ce);

intern = Z_DOCUMENT_OBJ_P(object);
intern->bson = copy ? bson_copy(bson) : bson;

return true;
}
22 changes: 22 additions & 0 deletions src/BSON/Document.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* Copyright 2023-present MongoDB, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#ifndef PHONGO_BSON_DOCUMENT_H
#define PHONGO_BSON_DOCUMENT_H

bool phongo_document_new(zval* object, bson_t* bson, bool copy);

#endif /* PHONGO_BSON_DOCUMENT_H */
7 changes: 1 addition & 6 deletions src/BSON/Document.stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,7 @@ final static public function fromPHP(array|object $value): Document {}
final static public function fromPHP($value): Document {}
#endif

#if PHP_VERSION_ID >= 80000
final public function get(string $key): mixed {}
#else
/** @return mixed */
final public function get(string $key) {}
#endif
final public function get(string $key): Value {}

final public function getIterator(): Iterator {}

Expand Down
22 changes: 2 additions & 20 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: 5994291bf2bfdac1b9d8bad9b96d4f443c2f49aa */
* Stub hash: a5464ed3bb6f730295df4e7945b5d3125b7af437 */

ZEND_BEGIN_ARG_INFO_EX(arginfo_class_MongoDB_BSON_Document___construct, 0, 0, 0)
ZEND_END_ARG_INFO()
Expand All @@ -24,17 +24,9 @@ ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_MongoDB_BSON_Document_fromP
ZEND_END_ARG_INFO()
#endif

#if PHP_VERSION_ID >= 80000
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_MongoDB_BSON_Document_get, 0, 1, IS_MIXED, 0)
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_MongoDB_BSON_Document_get, 0, 1, MongoDB\\BSON\\Value, 0)
ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0)
ZEND_END_ARG_INFO()
#endif

#if !(PHP_VERSION_ID >= 80000)
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_MongoDB_BSON_Document_get, 0, 0, 1)
ZEND_ARG_TYPE_INFO(0, key, IS_STRING, 0)
ZEND_END_ARG_INFO()
#endif

ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_MongoDB_BSON_Document_getIterator, 0, 0, MongoDB\\BSON\\Iterator, 0)
ZEND_END_ARG_INFO()
Expand Down Expand Up @@ -89,12 +81,7 @@ static ZEND_METHOD(MongoDB_BSON_Document, fromPHP);
#if !(PHP_VERSION_ID >= 80000)
static ZEND_METHOD(MongoDB_BSON_Document, fromPHP);
#endif
#if PHP_VERSION_ID >= 80000
static ZEND_METHOD(MongoDB_BSON_Document, get);
#endif
#if !(PHP_VERSION_ID >= 80000)
static ZEND_METHOD(MongoDB_BSON_Document, get);
#endif
static ZEND_METHOD(MongoDB_BSON_Document, getIterator);
static ZEND_METHOD(MongoDB_BSON_Document, has);
#if PHP_VERSION_ID >= 80000
Expand Down Expand Up @@ -123,12 +110,7 @@ static const zend_function_entry class_MongoDB_BSON_Document_methods[] = {
#if !(PHP_VERSION_ID >= 80000)
ZEND_ME(MongoDB_BSON_Document, fromPHP, arginfo_class_MongoDB_BSON_Document_fromPHP, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC|ZEND_ACC_FINAL)
#endif
#if PHP_VERSION_ID >= 80000
ZEND_ME(MongoDB_BSON_Document, get, arginfo_class_MongoDB_BSON_Document_get, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
#endif
#if !(PHP_VERSION_ID >= 80000)
ZEND_ME(MongoDB_BSON_Document, get, arginfo_class_MongoDB_BSON_Document_get, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
#endif
ZEND_ME(MongoDB_BSON_Document, getIterator, arginfo_class_MongoDB_BSON_Document_getIterator, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
ZEND_ME(MongoDB_BSON_Document, has, arginfo_class_MongoDB_BSON_Document_has, ZEND_ACC_PUBLIC|ZEND_ACC_FINAL)
#if PHP_VERSION_ID >= 80000
Expand Down
Loading