Skip to content

Commit

Permalink
PHPC-2128: Create stub file for functions (#1349)
Browse files Browse the repository at this point in the history
* PHPC-2128: Create stub file for functions

* Fix wrong phpdoc comment formatting
  • Loading branch information
alcaeus committed Aug 26, 2022
1 parent de5f1e5 commit 2b03e66
Show file tree
Hide file tree
Showing 59 changed files with 237 additions and 206 deletions.
42 changes: 3 additions & 39 deletions php_phongo.c
Expand Up @@ -28,8 +28,7 @@
#include "src/phongo_client.h"
#include "src/phongo_error.h"
#include "src/phongo_ini.h"
#include "src/BSON/functions.h"
#include "src/MongoDB/Monitoring/functions.h"
#include "src/functions_arginfo.h"

ZEND_DECLARE_MODULE_GLOBALS(mongodb)
#if defined(ZTS) && defined(COMPILE_DL_MONGODB)
Expand Down Expand Up @@ -483,42 +482,7 @@ PHP_FUNCTION(MongoDB_disabled___wakeup) /* {{{ */
} /* }}} */
/* }}} */

/* {{{ Extension functions, module dependencies, and module entry */
ZEND_BEGIN_ARG_INFO_EX(ai_bson_fromPHP, 0, 0, 1)
ZEND_ARG_INFO(0, value)
ZEND_END_ARG_INFO();

ZEND_BEGIN_ARG_INFO_EX(ai_bson_toPHP, 0, 0, 1)
ZEND_ARG_INFO(0, bson)
ZEND_ARG_ARRAY_INFO(0, typemap, 0)
ZEND_END_ARG_INFO();

ZEND_BEGIN_ARG_INFO_EX(ai_bson_toJSON, 0, 0, 1)
ZEND_ARG_INFO(0, bson)
ZEND_END_ARG_INFO();

ZEND_BEGIN_ARG_INFO_EX(ai_bson_fromJSON, 0, 0, 1)
ZEND_ARG_INFO(0, json)
ZEND_END_ARG_INFO();

ZEND_BEGIN_ARG_INFO_EX(ai_mongodb_driver_monitoring_subscriber, 0, 0, 1)
ZEND_ARG_OBJ_INFO(0, subscriber, MongoDB\\Driver\\Monitoring\\Subscriber, 0)
ZEND_END_ARG_INFO();

static const zend_function_entry mongodb_functions[] = {
/* clang-format off */
ZEND_NS_NAMED_FE("MongoDB\\BSON", fromPHP, PHP_FN(MongoDB_BSON_fromPHP), ai_bson_fromPHP)
ZEND_NS_NAMED_FE("MongoDB\\BSON", toPHP, PHP_FN(MongoDB_BSON_toPHP), ai_bson_toPHP)
ZEND_NS_NAMED_FE("MongoDB\\BSON", toJSON, PHP_FN(MongoDB_BSON_toJSON), ai_bson_toJSON)
ZEND_NS_NAMED_FE("MongoDB\\BSON", toCanonicalExtendedJSON, PHP_FN(MongoDB_BSON_toCanonicalExtendedJSON), ai_bson_toJSON)
ZEND_NS_NAMED_FE("MongoDB\\BSON", toRelaxedExtendedJSON, PHP_FN(MongoDB_BSON_toRelaxedExtendedJSON), ai_bson_toJSON)
ZEND_NS_NAMED_FE("MongoDB\\BSON", fromJSON, PHP_FN(MongoDB_BSON_fromJSON), ai_bson_fromJSON)
ZEND_NS_NAMED_FE("MongoDB\\Driver\\Monitoring", addSubscriber, PHP_FN(MongoDB_Driver_Monitoring_addSubscriber), ai_mongodb_driver_monitoring_subscriber)
ZEND_NS_NAMED_FE("MongoDB\\Driver\\Monitoring", removeSubscriber, PHP_FN(MongoDB_Driver_Monitoring_removeSubscriber), ai_mongodb_driver_monitoring_subscriber)
PHP_FE_END
/* clang-format on */
};

/* {{{ Module dependencies and module entry */
static const zend_module_dep mongodb_deps[] = {
/* clang-format off */
ZEND_MOD_REQUIRED("date")
Expand All @@ -534,7 +498,7 @@ zend_module_entry mongodb_module_entry = {
NULL,
mongodb_deps,
"mongodb",
mongodb_functions,
ext_functions,
PHP_MINIT(mongodb),
PHP_MSHUTDOWN(mongodb),
PHP_RINIT(mongodb),
Expand Down
6 changes: 3 additions & 3 deletions src/BSON/Binary.stub.php
@@ -1,9 +1,9 @@
<?php

/**
* @generate-class-entries static
* @generate-function-entries static
*/
* @generate-class-entries static
* @generate-function-entries static
*/

namespace MongoDB\BSON;

Expand Down
6 changes: 3 additions & 3 deletions src/BSON/BinaryInterface.stub.php
@@ -1,9 +1,9 @@
<?php

/**
* @generate-class-entries static
* @generate-function-entries
*/
* @generate-class-entries static
* @generate-function-entries
*/

namespace MongoDB\BSON;

Expand Down
2 changes: 1 addition & 1 deletion src/BSON/BinaryInterface_arginfo.h
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: 07bf399f3506a13fc4026d90cb58226598905092 */
* Stub hash: 9177931b152386567f53fed87887207971acceaf */

ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_MongoDB_BSON_BinaryInterface_getData, 0, 0, IS_STRING, 0)
ZEND_END_ARG_INFO()
Expand Down
2 changes: 1 addition & 1 deletion src/BSON/Binary_arginfo.h
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: bd94329bd8849c9bcb93b41699a19589f1fb905b */
* Stub hash: fac819b0ca7564fd16a3a7f972a5b3cbee650c04 */

ZEND_BEGIN_ARG_INFO_EX(arginfo_class_MongoDB_BSON_Binary___construct, 0, 0, 2)
ZEND_ARG_TYPE_INFO(0, data, IS_STRING, 0)
Expand Down
6 changes: 3 additions & 3 deletions src/BSON/DBPointer.stub.php
@@ -1,9 +1,9 @@
<?php

/**
* @generate-class-entries static
* @generate-function-entries static
*/
* @generate-class-entries static
* @generate-function-entries static
*/

namespace MongoDB\BSON;
final class DBPointer implements \JsonSerializable, Type, \Serializable
Expand Down
2 changes: 1 addition & 1 deletion src/BSON/DBPointer_arginfo.h
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: 93eae6546a9e300831dedd1a1912685657e8bc00 */
* Stub hash: 715bc228895c936eb673a93d58750c38fe83f210 */

ZEND_BEGIN_ARG_INFO_EX(arginfo_class_MongoDB_BSON_DBPointer___construct, 0, 0, 0)
ZEND_END_ARG_INFO()
Expand Down
6 changes: 3 additions & 3 deletions src/BSON/Decimal128.stub.php
@@ -1,9 +1,9 @@
<?php

/**
* @generate-class-entries static
* @generate-function-entries static
*/
* @generate-class-entries static
* @generate-function-entries static
*/

namespace MongoDB\BSON;

Expand Down
6 changes: 3 additions & 3 deletions src/BSON/Decimal128Interface.stub.php
@@ -1,9 +1,9 @@
<?php

/**
* @generate-class-entries static
* @generate-function-entries
*/
* @generate-class-entries static
* @generate-function-entries
*/

namespace MongoDB\BSON;

Expand Down
2 changes: 1 addition & 1 deletion src/BSON/Decimal128Interface_arginfo.h
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: 8e3bdf5ec19b8267107a1f66c2c31739d935a611 */
* Stub hash: d6d5d5cf0e586b9d76d208ea72b851da3cd37c34 */

ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_MongoDB_BSON_Decimal128Interface___toString, 0, 0, IS_STRING, 0)
ZEND_END_ARG_INFO()
Expand Down
2 changes: 1 addition & 1 deletion src/BSON/Decimal128_arginfo.h
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: be5acdbf8df3109c3c50f10bbd1ab8b4e96875e6 */
* Stub hash: b26119e42fe5a51a4f6eec2c9876c8129c275a15 */

ZEND_BEGIN_ARG_INFO_EX(arginfo_class_MongoDB_BSON_Decimal128___construct, 0, 0, 1)
ZEND_ARG_TYPE_INFO(0, value, IS_STRING, 0)
Expand Down
6 changes: 3 additions & 3 deletions src/BSON/Int64.stub.php
@@ -1,9 +1,9 @@
<?php

/**
* @generate-class-entries static
* @generate-function-entries static
*/
* @generate-class-entries static
* @generate-function-entries static
*/

namespace MongoDB\BSON;

Expand Down
2 changes: 1 addition & 1 deletion src/BSON/Int64_arginfo.h
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: b82e697d10a284a301c3110f0e947ee45bdc555c */
* Stub hash: 852eeededa19c9411c8fa9b0b364b86759e4819d */

ZEND_BEGIN_ARG_INFO_EX(arginfo_class_MongoDB_BSON_Int64___construct, 0, 0, 0)
ZEND_END_ARG_INFO()
Expand Down
6 changes: 3 additions & 3 deletions src/BSON/Javascript.stub.php
@@ -1,9 +1,9 @@
<?php

/**
* @generate-class-entries static
* @generate-function-entries static
*/
* @generate-class-entries static
* @generate-function-entries static
*/

namespace MongoDB\BSON;

Expand Down
6 changes: 3 additions & 3 deletions src/BSON/JavascriptInterface.stub.php
@@ -1,9 +1,9 @@
<?php

/**
* @generate-class-entries static
* @generate-function-entries
*/
* @generate-class-entries static
* @generate-function-entries
*/

namespace MongoDB\BSON;

Expand Down
2 changes: 1 addition & 1 deletion src/BSON/JavascriptInterface_arginfo.h
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: e1aced8ac16b4214e8c1aeb4c02916f82f5ddba4 */
* Stub hash: 82f701e4bbef2f207a3058c7875991b7a61617a9 */

ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_MongoDB_BSON_JavascriptInterface_getCode, 0, 0, IS_STRING, 0)
ZEND_END_ARG_INFO()
Expand Down
2 changes: 1 addition & 1 deletion src/BSON/Javascript_arginfo.h
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: d6c761a209314b8b183a5ef806ff077f0936aff4 */
* Stub hash: 93a9d4c9533665bb2153b9c2f0c9a7ae7e0f4063 */

#if PHP_VERSION_ID >= 80000
ZEND_BEGIN_ARG_INFO_EX(arginfo_class_MongoDB_BSON_Javascript___construct, 0, 0, 1)
Expand Down
6 changes: 3 additions & 3 deletions src/BSON/MaxKey.stub.php
@@ -1,9 +1,9 @@
<?php

/**
* @generate-class-entries static
* @generate-function-entries static
*/
* @generate-class-entries static
* @generate-function-entries static
*/

namespace MongoDB\BSON;

Expand Down
6 changes: 3 additions & 3 deletions src/BSON/MaxKeyInterface.stub.php
@@ -1,9 +1,9 @@
<?php

/**
* @generate-class-entries static
* @generate-function-entries
*/
* @generate-class-entries static
* @generate-function-entries
*/

namespace MongoDB\BSON;

Expand Down
2 changes: 1 addition & 1 deletion src/BSON/MaxKeyInterface_arginfo.h
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: 5daff813c44bcd25309b064a26d58ea3e2e101bf */
* Stub hash: 6c27815fcc33b0b03365b6b24d4145d8621cf13d */



Expand Down
2 changes: 1 addition & 1 deletion src/BSON/MaxKey_arginfo.h
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: d51b2b42e3bcce4fc655379f5b97ca8aec7a7b06 */
* Stub hash: 846934164a9297c9f8ce4ac61862d8fe62ec1594 */

ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_MongoDB_BSON_MaxKey___set_state, 0, 1, MongoDB\\BSON\\MaxKey, 0)
ZEND_ARG_TYPE_INFO(0, properties, IS_ARRAY, 0)
Expand Down
6 changes: 3 additions & 3 deletions src/BSON/MinKey.stub.php
@@ -1,9 +1,9 @@
<?php

/**
* @generate-class-entries static
* @generate-function-entries static
*/
* @generate-class-entries static
* @generate-function-entries static
*/

namespace MongoDB\BSON;

Expand Down
6 changes: 3 additions & 3 deletions src/BSON/MinKeyInterface.stub.php
@@ -1,9 +1,9 @@
<?php

/**
* @generate-class-entries static
* @generate-function-entries
*/
* @generate-class-entries static
* @generate-function-entries
*/

namespace MongoDB\BSON;

Expand Down
2 changes: 1 addition & 1 deletion src/BSON/MinKeyInterface_arginfo.h
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: d89b62cfa857d8c0d930cb3a85e1e9a4b459e4b0 */
* Stub hash: c9b23e875d9dc9ebb0ed3391d88cb2458ed96407 */



Expand Down
2 changes: 1 addition & 1 deletion src/BSON/MinKey_arginfo.h
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: bceebd5cd96405600260a3b38bb7f4afb55cf998 */
* Stub hash: 4e88611e3a9becb0c24acee79f1bfc7004b912b5 */

ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(arginfo_class_MongoDB_BSON_MinKey___set_state, 0, 1, MongoDB\\BSON\\MinKey, 0)
ZEND_ARG_TYPE_INFO(0, properties, IS_ARRAY, 0)
Expand Down
6 changes: 3 additions & 3 deletions src/BSON/ObjectId.stub.php
@@ -1,9 +1,9 @@
<?php

/**
* @generate-class-entries static
* @generate-function-entries static
*/
* @generate-class-entries static
* @generate-function-entries static
*/

namespace MongoDB\BSON;

Expand Down
6 changes: 3 additions & 3 deletions src/BSON/ObjectIdInterface.stub.php
@@ -1,9 +1,9 @@
<?php

/**
* @generate-class-entries static
* @generate-function-entries
*/
* @generate-class-entries static
* @generate-function-entries
*/

namespace MongoDB\BSON;

Expand Down
2 changes: 1 addition & 1 deletion src/BSON/ObjectIdInterface_arginfo.h
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: 462040ee782f5bbafdfd32a24b43b26ff3c305bb */
* Stub hash: b68b5dcd9eb41216be44fbcd5fc80349e6fcefd0 */

ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_MongoDB_BSON_ObjectIdInterface_getTimestamp, 0, 0, IS_LONG, 0)
ZEND_END_ARG_INFO()
Expand Down
2 changes: 1 addition & 1 deletion src/BSON/ObjectId_arginfo.h
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: 1da0211fe28a1ce4bd6dfae362b693cf91b3f859 */
* Stub hash: 7a5ff8ba8699e4874e755a2694daadc098cf158d */

ZEND_BEGIN_ARG_INFO_EX(arginfo_class_MongoDB_BSON_ObjectId___construct, 0, 0, 0)
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, id, IS_STRING, 1, "null")
Expand Down
6 changes: 3 additions & 3 deletions src/BSON/Persistable.stub.php
@@ -1,9 +1,9 @@
<?php

/**
* @generate-class-entries static
* @generate-function-entries
*/
* @generate-class-entries static
* @generate-function-entries
*/

namespace MongoDB\BSON;

Expand Down
2 changes: 1 addition & 1 deletion src/BSON/Persistable_arginfo.h
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: daf8e224ad79ad7e551fd104cb52d31022f5d0b4 */
* Stub hash: babd07f95f47c3b66228ef23b66ab0446cd5c308 */



Expand Down
6 changes: 3 additions & 3 deletions src/BSON/Regex.stub.php
@@ -1,9 +1,9 @@
<?php

/**
* @generate-class-entries static
* @generate-function-entries static
*/
* @generate-class-entries static
* @generate-function-entries static
*/

namespace MongoDB\BSON;

Expand Down
6 changes: 3 additions & 3 deletions src/BSON/RegexInterface.stub.php
@@ -1,9 +1,9 @@
<?php

/**
* @generate-class-entries static
* @generate-function-entries
*/
* @generate-class-entries static
* @generate-function-entries
*/

namespace MongoDB\BSON;

Expand Down
2 changes: 1 addition & 1 deletion src/BSON/RegexInterface_arginfo.h
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
* Stub hash: 38b21216ed0d4a03e8661e2605190045595126a9 */
* Stub hash: 72a53fb51ca60f8ccb38a73afe74f76fb81bac71 */

ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(arginfo_class_MongoDB_BSON_RegexInterface_getPattern, 0, 0, IS_STRING, 0)
ZEND_END_ARG_INFO()
Expand Down

0 comments on commit 2b03e66

Please sign in to comment.