From 7d0102dfa70ca000af0cd4027e8c07a89ad14de2 Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Mon, 17 Feb 2020 08:55:18 +0100 Subject: [PATCH] Revert "Replace @param annotations with type declarations" This reverts commit c31029f335ca1b453af799805c43c37e959ad555. --- ext/dba/dba.stub.php | 15 ++-- ext/dba/dba_arginfo.h | 6 +- ext/gmp/gmp.stub.php | 3 +- ext/gmp/gmp_arginfo.h | 2 +- ext/intl/calendar/calendar.stub.php | 6 +- ext/intl/calendar/calendar_arginfo.h | 4 +- ext/intl/formatter/formatter.stub.php | 6 +- ext/intl/formatter/formatter_arginfo.h | 4 +- .../resourcebundle/resourcebundle.stub.php | 6 +- .../resourcebundle/resourcebundle_arginfo.h | 4 +- ext/ldap/ldap.stub.php | 12 ++- ext/ldap/ldap_arginfo.h | 4 +- ext/mbstring/mbstring.stub.php | 6 +- ext/mbstring/mbstring_arginfo.h | 4 +- ext/odbc/odbc.stub.php | 3 +- ext/odbc/odbc_arginfo.h | 2 +- ext/openssl/openssl.stub.php | 6 +- ext/openssl/openssl_arginfo.h | 4 +- ext/pcre/php_pcre.stub.php | 22 +++++- ext/pcre/php_pcre_arginfo.h | 12 +-- ext/pdo/pdo.stub.php | 3 +- ext/pdo/pdo_arginfo.h | 2 +- ext/reflection/php_reflection.stub.php | 18 +++-- ext/reflection/php_reflection_arginfo.h | 17 ++--- .../tests/ReflectionClass_toString_001.phpt | 2 +- .../tests/ReflectionMethod_basic2.phpt | 4 +- ext/snmp/snmp.stub.php | 74 ++++++++++++++----- ext/snmp/snmp_arginfo.h | 28 +++---- ext/standard/basic_functions.stub.php | 35 ++++++--- ext/standard/basic_functions_arginfo.h | 18 ++--- ext/tidy/tidy.stub.php | 27 ++++--- ext/tidy/tidy_arginfo.h | 18 ++--- sapi/cli/tests/006.phpt | 18 ++--- 33 files changed, 249 insertions(+), 146 deletions(-) diff --git a/ext/dba/dba.stub.php b/ext/dba/dba.stub.php index 4c476a984b..96ce6d573a 100644 --- a/ext/dba/dba.stub.php +++ b/ext/dba/dba.stub.php @@ -10,15 +10,17 @@ function dba_open($path, $mode, $handlername = UNKNOWN, ...$handler_parameters) function dba_close($handle): void {} /** + * @param string|array $key * @param resource $handle */ -function dba_exists(string|array $key, $handle): bool {} +function dba_exists($key, $handle): bool {} /** + * @param string|array $key * @param int|resource $skip actually this parameter is optional, not $handle * @param resource $handle */ -function dba_fetch(string|array $key, $skip, $handle = UNKOWN): string|false {} +function dba_fetch($key, $skip, $handle = UNKOWN): string|false {} function dba_key_split(string $key): array|false {} @@ -29,19 +31,22 @@ function dba_firstkey($handle): string|false {} function dba_nextkey($handle): string|false {} /** + * @param string|array $key * @param resource $handle */ -function dba_delete(string|array $key, $handle): bool {} +function dba_delete($key, $handle): bool {} /** + * @param string|array $key * @param resource $handle */ -function dba_insert(string|array $key, string $value, $handle): bool {} +function dba_insert($key, string $value, $handle): bool {} /** + * @param string|array $key * @param resource $handle */ -function dba_replace(string|array $key, string $value, $handle): bool {} +function dba_replace($key, string $value, $handle): bool {} /** @param resource $handle */ function dba_optimize($handle): bool {} diff --git a/ext/dba/dba_arginfo.h b/ext/dba/dba_arginfo.h index 0b14c33a57..32e925fb6a 100644 --- a/ext/dba/dba_arginfo.h +++ b/ext/dba/dba_arginfo.h @@ -14,12 +14,12 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_dba_close, 0, 1, IS_VOID, 0) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_dba_exists, 0, 2, _IS_BOOL, 0) - ZEND_ARG_TYPE_MASK(0, key, MAY_BE_STRING|MAY_BE_ARRAY) + ZEND_ARG_INFO(0, key) ZEND_ARG_INFO(0, handle) ZEND_END_ARG_INFO() ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_dba_fetch, 0, 2, MAY_BE_STRING|MAY_BE_FALSE) - ZEND_ARG_TYPE_MASK(0, key, MAY_BE_STRING|MAY_BE_ARRAY) + ZEND_ARG_INFO(0, key) ZEND_ARG_INFO(0, skip) ZEND_ARG_INFO(0, handle) ZEND_END_ARG_INFO() @@ -37,7 +37,7 @@ ZEND_END_ARG_INFO() #define arginfo_dba_delete arginfo_dba_exists ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_dba_insert, 0, 3, _IS_BOOL, 0) - ZEND_ARG_TYPE_MASK(0, key, MAY_BE_STRING|MAY_BE_ARRAY) + ZEND_ARG_INFO(0, key) ZEND_ARG_TYPE_INFO(0, value, IS_STRING, 0) ZEND_ARG_INFO(0, handle) ZEND_END_ARG_INFO() diff --git a/ext/gmp/gmp.stub.php b/ext/gmp/gmp.stub.php index 2fedff9458..7f576ca0c1 100644 --- a/ext/gmp/gmp.stub.php +++ b/ext/gmp/gmp.stub.php @@ -1,6 +1,7 @@ class ReflectionClass implements Reflector ] { Method [ public method __construct ] { - Parameters [1] { - Parameter #0 [ object|string $argument ] + Parameter #0 [ $argument ] } } diff --git a/ext/reflection/tests/ReflectionMethod_basic2.phpt b/ext/reflection/tests/ReflectionMethod_basic2.phpt index e460545e55..46abc6b816 100644 --- a/ext/reflection/tests/ReflectionMethod_basic2.phpt +++ b/ext/reflection/tests/ReflectionMethod_basic2.phpt @@ -165,7 +165,7 @@ __toString(): string(%d) "Method [ public method __construct ] { - Parameters [2] { - Parameter #0 [ object|string $class ] + Parameter #0 [ $class ] Parameter #1 [ string $name ] } } @@ -177,7 +177,7 @@ Deprecated: Function ReflectionMethod::export() is deprecated in %s on line %d string(%d) "Method [ public method __construct ] { - Parameters [2] { - Parameter #0 [ object|string $class ] + Parameter #0 [ $class ] Parameter #1 [ string $name ] } } diff --git a/ext/snmp/snmp.stub.php b/ext/snmp/snmp.stub.php index 5f6b8fe3d6..ce085637be 100644 --- a/ext/snmp/snmp.stub.php +++ b/ext/snmp/snmp.stub.php @@ -1,16 +1,26 @@ extension #%d pcre version %s ] { Function [ function preg_replace ] { - Parameters [5] { - Parameter #0 [ array|string $regex ] - Parameter #1 [ array|string $replace ] - Parameter #2 [ array|string $subject ] + Parameter #0 [ $regex ] + Parameter #1 [ $replace ] + Parameter #2 [ $subject ] Parameter #3 [ int $limit ] Parameter #4 [ &$count ] } @@ -101,9 +101,9 @@ string(%d) "Extension [ extension #%d pcre version %s ] { Function [ function preg_replace_callback ] { - Parameters [6] { - Parameter #0 [ array|string $regex ] + Parameter #0 [ $regex ] Parameter #1 [ $callback ] - Parameter #2 [ array|string $subject ] + Parameter #2 [ $subject ] Parameter #3 [ int $limit ] Parameter #4 [ &$count ] Parameter #5 [ int $flags ] @@ -114,7 +114,7 @@ string(%d) "Extension [ extension #%d pcre version %s ] { - Parameters [5] { Parameter #0 [ array $pattern ] - Parameter #1 [ array|string $subject ] + Parameter #1 [ $subject ] Parameter #2 [ int $limit ] Parameter #3 [ &$count ] Parameter #4 [ int $flags ] @@ -124,9 +124,9 @@ string(%d) "Extension [ extension #%d pcre version %s ] { Function [ function preg_filter ] { - Parameters [5] { - Parameter #0 [ array|string $regex ] - Parameter #1 [ array|string $replace ] - Parameter #2 [ array|string $subject ] + Parameter #0 [ $regex ] + Parameter #1 [ $replace ] + Parameter #2 [ $subject ] Parameter #3 [ int $limit ] Parameter #4 [ &$count ] } -- 2.50.0