diff options
author | Máté Kocsis <kocsismate@woohoolabs.com> | 2020-05-28 12:40:54 +0200 |
---|---|---|
committer | Máté Kocsis <kocsismate@woohoolabs.com> | 2020-05-28 12:41:48 +0200 |
commit | 58cb0e473247518931d128c473c8121a66cae932 (patch) | |
tree | 92f3d39a027e8d97cc5dcf7638a44bbfb4179fcf | |
parent | 01e86d6d703e45bd79ba082053ef0f917407019f (diff) | |
download | php-git-58cb0e473247518931d128c473c8121a66cae932.tar.gz |
Add some mixed parameter types and fix UNKNOWN default values in ext/xmlrpc
-rw-r--r-- | ext/xmlrpc/xmlrpc-epi-php.c | 8 | ||||
-rw-r--r-- | ext/xmlrpc/xmlrpc.stub.php | 6 | ||||
-rw-r--r-- | ext/xmlrpc/xmlrpc_arginfo.h | 10 |
3 files changed, 10 insertions, 14 deletions
diff --git a/ext/xmlrpc/xmlrpc-epi-php.c b/ext/xmlrpc/xmlrpc-epi-php.c index d1a1e37eca..9c2f569f55 100644 --- a/ext/xmlrpc/xmlrpc-epi-php.c +++ b/ext/xmlrpc/xmlrpc-epi-php.c @@ -966,12 +966,8 @@ PHP_FUNCTION(xmlrpc_server_call_method) if (zend_parse_parameters(argc, "Osz|a", &handle, xmlrpc_server_ce, &rawxml, &rawxml_len, &caller_params, &output_opts) != SUCCESS) { RETURN_THROWS(); } - /* user output options */ - if (argc == 3) { - set_output_options(&out, NULL); - } else { - set_output_options(&out, output_opts); - } + + set_output_options(&out, output_opts ? output_opts : NULL); server = Z_XMLRPC_SERVER_P(handle); diff --git a/ext/xmlrpc/xmlrpc.stub.php b/ext/xmlrpc/xmlrpc.stub.php index e97a3d08ba..633a6f35d3 100644 --- a/ext/xmlrpc/xmlrpc.stub.php +++ b/ext/xmlrpc/xmlrpc.stub.php @@ -6,13 +6,13 @@ final class XmlRpcServer { } -function xmlrpc_encode($value): ?string {} +function xmlrpc_encode(mixed $value): ?string {} function xmlrpc_decode(string $xml, string $encoding = "iso-8859-1"): mixed {} function xmlrpc_decode_request(string $xml, &$method, string $encoding = "iso-8859-1"): mixed {} -function xmlrpc_encode_request(?string $method, $params, array $output_options = UNKNOWN): ?string {} +function xmlrpc_encode_request(?string $method, mixed $params, array $output_options = []): ?string {} function xmlrpc_get_type(mixed $value): string {} @@ -26,7 +26,7 @@ function xmlrpc_server_destroy(XmlRpcServer $server): bool {} function xmlrpc_server_register_method(XmlRpcServer $server, string $method_name, $function): bool {} -function xmlrpc_server_call_method(XmlRpcServer $server, string $xml, $user_data, array $output_options = UNKNOWN): mixed {} +function xmlrpc_server_call_method(XmlRpcServer $server, string $xml, mixed $user_data, array $output_options = []): mixed {} function xmlrpc_parse_method_descriptions(string $xml): mixed {} diff --git a/ext/xmlrpc/xmlrpc_arginfo.h b/ext/xmlrpc/xmlrpc_arginfo.h index 0a5d1198f8..8b7f77c181 100644 --- a/ext/xmlrpc/xmlrpc_arginfo.h +++ b/ext/xmlrpc/xmlrpc_arginfo.h @@ -1,7 +1,7 @@ /* This is a generated file, edit the .stub.php file instead. */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_xmlrpc_encode, 0, 1, IS_STRING, 1) - ZEND_ARG_INFO(0, value) + ZEND_ARG_TYPE_INFO(0, value, IS_MIXED, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_xmlrpc_decode, 0, 1, IS_MIXED, 0) @@ -17,8 +17,8 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_xmlrpc_encode_request, 0, 2, IS_STRING, 1) ZEND_ARG_TYPE_INFO(0, method, IS_STRING, 1) - ZEND_ARG_INFO(0, params) - ZEND_ARG_TYPE_INFO(0, output_options, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO(0, params, IS_MIXED, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, output_options, IS_ARRAY, 0, "[]") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_xmlrpc_get_type, 0, 1, IS_STRING, 0) @@ -50,8 +50,8 @@ ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_xmlrpc_server_call_method, 0, 3, IS_MIXED, 0) ZEND_ARG_OBJ_INFO(0, server, XmlRpcServer, 0) ZEND_ARG_TYPE_INFO(0, xml, IS_STRING, 0) - ZEND_ARG_INFO(0, user_data) - ZEND_ARG_TYPE_INFO(0, output_options, IS_ARRAY, 0) + ZEND_ARG_TYPE_INFO(0, user_data, IS_MIXED, 0) + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, output_options, IS_ARRAY, 0, "[]") ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_xmlrpc_parse_method_descriptions, 0, 1, IS_MIXED, 0) |