]> granicus.if.org Git - php/commitdiff
Add some mixed parameter types and fix UNKNOWN default values in ext/xmlrpc
authorMáté Kocsis <kocsismate@woohoolabs.com>
Thu, 28 May 2020 10:40:54 +0000 (12:40 +0200)
committerMáté Kocsis <kocsismate@woohoolabs.com>
Thu, 28 May 2020 10:41:48 +0000 (12:41 +0200)
ext/xmlrpc/xmlrpc-epi-php.c
ext/xmlrpc/xmlrpc.stub.php
ext/xmlrpc/xmlrpc_arginfo.h

index d1a1e37eca9a0eb3735a6b8fdb01cd102b750405..9c2f569f55e7e597baa17dce420c4177a6ea7ae6 100644 (file)
@@ -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);
 
index e97a3d08baa6318ac23f21e3599228a4223c81f6..633a6f35d33965db66db8a935a7e34442c1b6cae 100644 (file)
@@ -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 {}
 
index 0a5d1198f821461f36a9afc83dfd910ddf9f187d..8b7f77c181f6c70b7ee4a3575440ea5a172cfb3e 100644 (file)
@@ -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)