-
Notifications
You must be signed in to change notification settings - Fork 208
PHPC-1709: Add typing information to arginfo #1337
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
Changes from all commits
553d9c5
8414fb1
b1a67c8
7441e3f
da90d6c
4d54c6f
cfccd01
770e95b
369a6df
0743d33
6a32dfb
71644db
b6e090d
773ff9d
d3e93a7
1c67059
fa78349
4833b1b
edde54c
767dd1a
d4d1afe
27012ad
0abee61
c9eea94
f54546a
49e526e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: "Check generated arginfo files" | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- "v*.*" | ||
- "master" | ||
- "feature/*" | ||
push: | ||
branches: | ||
- "v*.*" | ||
- "master" | ||
- "feature/*" | ||
|
||
jobs: | ||
check-arginfo: | ||
name: "Check generated arginfo files" | ||
runs-on: "ubuntu-20.04" | ||
|
||
strategy: | ||
matrix: | ||
php-version: | ||
- "8.2" | ||
|
||
steps: | ||
- name: "Checkout" | ||
uses: "actions/checkout@v2" | ||
with: | ||
submodules: true | ||
|
||
- name: "Install PHP" | ||
uses: "shivammathur/setup-php@v2" | ||
with: | ||
php-version: "${{ matrix.php-version }}" | ||
tools: "phpize" | ||
|
||
- name: "Run phpize" | ||
run: phpize | ||
|
||
- name: "Rebuild arginfo files from stubs" | ||
run: "php ./build/gen_stub.php" | ||
|
||
- name: "Check arginfo file diff" | ||
run: git add . -N && git diff --exit-code |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,6 +41,7 @@ mongocryptd.pid | |
*.out | ||
*.mem | ||
*.php | ||
!*.stub.php | ||
tests/*/*.sh | ||
tests/*/*/*/*.sh | ||
tests/*/*/*/*/*.sh | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,7 @@ | |
|
||
#include "php_phongo.h" | ||
#include "phongo_error.h" | ||
#include "Binary_arginfo.h" | ||
|
||
#define PHONGO_BINARY_UUID_SIZE 16 | ||
|
||
|
@@ -92,7 +93,7 @@ static HashTable* php_phongo_binary_get_properties_hash(phongo_compat_object_han | |
|
||
/* {{{ proto void MongoDB\BSON\Binary::__construct(string $data, int $type) | ||
Construct a new BSON binary type */ | ||
static PHP_METHOD(Binary, __construct) | ||
static PHP_METHOD(MongoDB_BSON_Binary, __construct) | ||
{ | ||
php_phongo_binary_t* intern; | ||
char* data; | ||
|
@@ -111,7 +112,7 @@ static PHP_METHOD(Binary, __construct) | |
|
||
/* {{{ proto MongoDB\BSON\Binary MongoDB\BSON\Binary::__set_state(array $properties) | ||
*/ | ||
static PHP_METHOD(Binary, __set_state) | ||
static PHP_METHOD(MongoDB_BSON_Binary, __set_state) | ||
{ | ||
php_phongo_binary_t* intern; | ||
HashTable* props; | ||
|
@@ -131,7 +132,7 @@ static PHP_METHOD(Binary, __set_state) | |
|
||
/* {{{ proto string MongoDB\BSON\Binary::__toString() | ||
Return the Binary's data string. */ | ||
static PHP_METHOD(Binary, __toString) | ||
static PHP_METHOD(MongoDB_BSON_Binary, __toString) | ||
{ | ||
php_phongo_binary_t* intern; | ||
|
||
|
@@ -144,7 +145,7 @@ static PHP_METHOD(Binary, __toString) | |
|
||
/* {{{ proto string MongoDB\BSON\Binary::getData() | ||
*/ | ||
static PHP_METHOD(Binary, getData) | ||
static PHP_METHOD(MongoDB_BSON_Binary, getData) | ||
{ | ||
php_phongo_binary_t* intern; | ||
|
||
|
@@ -157,7 +158,7 @@ static PHP_METHOD(Binary, getData) | |
|
||
/* {{{ proto integer MongoDB\BSON\Binary::getType() | ||
*/ | ||
static PHP_METHOD(Binary, getType) | ||
static PHP_METHOD(MongoDB_BSON_Binary, getType) | ||
{ | ||
php_phongo_binary_t* intern; | ||
|
||
|
@@ -170,7 +171,7 @@ static PHP_METHOD(Binary, getType) | |
|
||
/* {{{ proto array MongoDB\BSON\Binary::jsonSerialize() | ||
*/ | ||
static PHP_METHOD(Binary, jsonSerialize) | ||
static PHP_METHOD(MongoDB_BSON_Binary, jsonSerialize) | ||
{ | ||
php_phongo_binary_t* intern; | ||
char type[3]; | ||
|
@@ -194,7 +195,7 @@ static PHP_METHOD(Binary, jsonSerialize) | |
|
||
/* {{{ proto string MongoDB\BSON\Binary::serialize() | ||
*/ | ||
static PHP_METHOD(Binary, serialize) | ||
static PHP_METHOD(MongoDB_BSON_Binary, serialize) | ||
{ | ||
php_phongo_binary_t* intern; | ||
zval retval; | ||
|
@@ -222,7 +223,7 @@ static PHP_METHOD(Binary, serialize) | |
|
||
/* {{{ proto void MongoDB\BSON\Binary::unserialize(string $serialized) | ||
*/ | ||
static PHP_METHOD(Binary, unserialize) | ||
static PHP_METHOD(MongoDB_BSON_Binary, unserialize) | ||
{ | ||
php_phongo_binary_t* intern; | ||
char* serialized; | ||
|
@@ -252,7 +253,7 @@ static PHP_METHOD(Binary, unserialize) | |
|
||
/* {{{ proto array MongoDB\Driver\Binary::__serialize() | ||
*/ | ||
static PHP_METHOD(Binary, __serialize) | ||
static PHP_METHOD(MongoDB_BSON_Binary, __serialize) | ||
{ | ||
PHONGO_PARSE_PARAMETERS_NONE(); | ||
|
||
|
@@ -261,7 +262,7 @@ static PHP_METHOD(Binary, __serialize) | |
|
||
/* {{{ proto void MongoDB\Driver\Binary::__unserialize(array $data) | ||
*/ | ||
static PHP_METHOD(Binary, __unserialize) | ||
static PHP_METHOD(MongoDB_BSON_Binary, __unserialize) | ||
{ | ||
zval* data; | ||
|
||
|
@@ -272,50 +273,6 @@ static PHP_METHOD(Binary, __unserialize) | |
php_phongo_binary_init_from_hash(Z_BINARY_OBJ_P(getThis()), Z_ARRVAL_P(data)); | ||
} /* }}} */ | ||
|
||
/* {{{ MongoDB\BSON\Binary function entries */ | ||
/* clang-format off */ | ||
ZEND_BEGIN_ARG_INFO_EX(ai_Binary___construct, 0, 0, 2) | ||
ZEND_ARG_INFO(0, data) | ||
ZEND_ARG_INFO(0, type) | ||
ZEND_END_ARG_INFO() | ||
|
||
ZEND_BEGIN_ARG_INFO_EX(ai_Binary___set_state, 0, 0, 1) | ||
ZEND_ARG_ARRAY_INFO(0, properties, 0) | ||
ZEND_END_ARG_INFO() | ||
|
||
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(ai_Binary___toString, 0, 0, IS_STRING, 0) | ||
ZEND_END_ARG_INFO() | ||
|
||
ZEND_BEGIN_ARG_INFO_EX(ai_Binary___unserialize, 0, 0, 1) | ||
ZEND_ARG_ARRAY_INFO(0, data, 0) | ||
ZEND_END_ARG_INFO() | ||
|
||
ZEND_BEGIN_ARG_WITH_TENTATIVE_RETURN_TYPE_INFO_EX(ai_Binary_jsonSerialize, 0, 0, IS_ARRAY, 0) | ||
ZEND_END_ARG_INFO() | ||
|
||
ZEND_BEGIN_ARG_INFO_EX(ai_Binary_unserialize, 0, 0, 1) | ||
ZEND_ARG_INFO(0, serialized) | ||
ZEND_END_ARG_INFO() | ||
|
||
ZEND_BEGIN_ARG_INFO_EX(ai_Binary_void, 0, 0, 0) | ||
ZEND_END_ARG_INFO() | ||
|
||
static zend_function_entry php_phongo_binary_me[] = { | ||
PHP_ME(Binary, __construct, ai_Binary___construct, ZEND_ACC_PUBLIC | ZEND_ACC_FINAL) | ||
PHP_ME(Binary, __serialize, ai_Binary_void, ZEND_ACC_PUBLIC | ZEND_ACC_FINAL) | ||
PHP_ME(Binary, __set_state, ai_Binary___set_state, ZEND_ACC_PUBLIC | ZEND_ACC_STATIC) | ||
PHP_ME(Binary, __toString, ai_Binary___toString, ZEND_ACC_PUBLIC | ZEND_ACC_FINAL) | ||
PHP_ME(Binary, __unserialize, ai_Binary___unserialize, ZEND_ACC_PUBLIC | ZEND_ACC_FINAL) | ||
PHP_ME(Binary, jsonSerialize, ai_Binary_jsonSerialize, ZEND_ACC_PUBLIC | ZEND_ACC_FINAL) | ||
PHP_ME(Binary, serialize, ai_Binary_void, ZEND_ACC_PUBLIC | ZEND_ACC_FINAL) | ||
PHP_ME(Binary, unserialize, ai_Binary_unserialize, ZEND_ACC_PUBLIC | ZEND_ACC_FINAL) | ||
PHP_ME(Binary, getData, ai_Binary_void, ZEND_ACC_PUBLIC | ZEND_ACC_FINAL) | ||
PHP_ME(Binary, getType, ai_Binary_void, ZEND_ACC_PUBLIC | ZEND_ACC_FINAL) | ||
PHP_FE_END | ||
}; | ||
/* clang-format on */ | ||
/* }}} */ | ||
|
||
/* {{{ MongoDB\BSON\Binary object handlers */ | ||
static zend_object_handlers php_phongo_handler_binary; | ||
|
||
|
@@ -400,17 +357,8 @@ static HashTable* php_phongo_binary_get_properties(phongo_compat_object_handler_ | |
|
||
void php_phongo_binary_init_ce(INIT_FUNC_ARGS) /* {{{ */ | ||
{ | ||
zend_class_entry ce; | ||
|
||
INIT_NS_CLASS_ENTRY(ce, "MongoDB\\BSON", "Binary", php_phongo_binary_me); | ||
php_phongo_binary_ce = zend_register_internal_class(&ce); | ||
php_phongo_binary_ce = register_class_MongoDB_BSON_Binary(php_phongo_binary_interface_ce, php_phongo_json_serializable_ce, php_phongo_type_ce, zend_ce_serializable); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This function is generated by specifying |
||
php_phongo_binary_ce->create_object = php_phongo_binary_create_object; | ||
PHONGO_CE_FINAL(php_phongo_binary_ce); | ||
|
||
zend_class_implements(php_phongo_binary_ce, 1, php_phongo_binary_interface_ce); | ||
zend_class_implements(php_phongo_binary_ce, 1, php_phongo_json_serializable_ce); | ||
zend_class_implements(php_phongo_binary_ce, 1, php_phongo_type_ce); | ||
zend_class_implements(php_phongo_binary_ce, 1, zend_ce_serializable); | ||
|
||
#if PHP_VERSION_ID >= 80000 | ||
zend_class_implements(php_phongo_binary_ce, 1, zend_ce_stringable); | ||
|
@@ -423,14 +371,4 @@ void php_phongo_binary_init_ce(INIT_FUNC_ARGS) /* {{{ */ | |
php_phongo_handler_binary.get_properties = php_phongo_binary_get_properties; | ||
php_phongo_handler_binary.free_obj = php_phongo_binary_free_object; | ||
php_phongo_handler_binary.offset = XtOffsetOf(php_phongo_binary_t, std); | ||
|
||
zend_declare_class_constant_long(php_phongo_binary_ce, ZEND_STRL("TYPE_GENERIC"), BSON_SUBTYPE_BINARY); | ||
zend_declare_class_constant_long(php_phongo_binary_ce, ZEND_STRL("TYPE_FUNCTION"), BSON_SUBTYPE_FUNCTION); | ||
zend_declare_class_constant_long(php_phongo_binary_ce, ZEND_STRL("TYPE_OLD_BINARY"), BSON_SUBTYPE_BINARY_DEPRECATED); | ||
zend_declare_class_constant_long(php_phongo_binary_ce, ZEND_STRL("TYPE_OLD_UUID"), BSON_SUBTYPE_UUID_DEPRECATED); | ||
zend_declare_class_constant_long(php_phongo_binary_ce, ZEND_STRL("TYPE_UUID"), BSON_SUBTYPE_UUID); | ||
zend_declare_class_constant_long(php_phongo_binary_ce, ZEND_STRL("TYPE_MD5"), BSON_SUBTYPE_MD5); | ||
zend_declare_class_constant_long(php_phongo_binary_ce, ZEND_STRL("TYPE_ENCRYPTED"), BSON_SUBTYPE_ENCRYPTED); | ||
zend_declare_class_constant_long(php_phongo_binary_ce, ZEND_STRL("TYPE_COLUMN"), BSON_SUBTYPE_COLUMN); | ||
zend_declare_class_constant_long(php_phongo_binary_ce, ZEND_STRL("TYPE_USER_DEFINED"), BSON_SUBTYPE_USER); | ||
} /* }}} */ |
Uh oh!
There was an error while loading. Please reload this page.