From e950ca13ea2e8f012ded007ac1251eea01269542 Mon Sep 17 00:00:00 2001 From: =?utf8?q?M=C3=A1t=C3=A9=20Kocsis?= Date: Sun, 20 Sep 2020 10:41:10 +0200 Subject: [PATCH] Consolidate the usage of "either" and "one of" in error messages Closes GH-6173 --- ext/ftp/php_ftp.c | 4 ++-- ext/ftp/tests/ftp_get_option.phpt | 2 +- ext/ftp/tests/ftp_set_option_errors.phpt | 2 +- ext/gd/gd.c | 2 +- ext/intl/grapheme/grapheme_string.c | 2 +- ext/intl/tests/bug62083.phpt | 2 +- ext/ldap/ldap.c | 2 +- ext/mbstring/mbstring.c | 5 ++-- .../tests/mb_convert_case_various_mode.phpt | 2 +- ext/mbstring/tests/mb_http_input.phpt | 2 +- ext/mysqli/mysqli_api.c | 3 +-- ext/mysqli/mysqli_nonapi.c | 2 +- ext/mysqli/tests/mysqli_query.phpt | 2 +- ext/mysqli/tests/mysqli_stmt_attr_set.phpt | 2 +- ext/pdo_odbc/pdo_odbc.c | 2 +- ext/reflection/php_reflection.c | 2 +- ...nParameter_invalidMethodInConstructor.phpt | 2 +- ext/snmp/snmp.c | 6 ++--- .../tests/snmp-object-setSecurity_error.phpt | 6 ++--- ext/snmp/tests/snmp3-error.phpt | 4 ++-- ext/soap/soap.c | 2 +- ext/sockets/sockets.c | 24 +++++++++---------- .../socket_create_pair-wrongparams-win32.phpt | 4 ++-- .../tests/socket_create_pair-wrongparams.phpt | 4 ++-- ext/standard/file.c | 2 +- ext/standard/tests/file/flock.phpt | 2 +- ext/standard/tests/file/flock_error.phpt | 8 +++---- ext/zlib/tests/007.phpt | 4 ++-- ext/zlib/tests/deflate_init_error.phpt | 2 +- ext/zlib/tests/gzcompress_error1.phpt | 2 +- ext/zlib/tests/gzdeflate_error1.phpt | 2 +- ext/zlib/tests/gzencode_error1.phpt | 2 +- ext/zlib/zlib.c | 6 ++--- sapi/phpdbg/phpdbg.c | 2 +- 34 files changed, 60 insertions(+), 62 deletions(-) diff --git a/ext/ftp/php_ftp.c b/ext/ftp/php_ftp.c index 0a185ef272..a6dca8c874 100644 --- a/ext/ftp/php_ftp.c +++ b/ext/ftp/php_ftp.c @@ -1284,7 +1284,7 @@ PHP_FUNCTION(ftp_set_option) RETURN_TRUE; break; default: - zend_argument_value_error(2, "must be either FTP_TIMEOUT_SEC, FTP_AUTOSEEK, or FTP_USEPASVADDRESS"); + zend_argument_value_error(2, "must be one of FTP_TIMEOUT_SEC, FTP_AUTOSEEK, or FTP_USEPASVADDRESS"); RETURN_THROWS(); break; } @@ -1317,7 +1317,7 @@ PHP_FUNCTION(ftp_get_option) RETURN_BOOL(ftp->usepasvaddress); break; default: - zend_argument_value_error(2, "must be either FTP_TIMEOUT_SEC, FTP_AUTOSEEK, or FTP_USEPASVADDRESS"); + zend_argument_value_error(2, "must be one of FTP_TIMEOUT_SEC, FTP_AUTOSEEK, or FTP_USEPASVADDRESS"); RETURN_THROWS(); } } diff --git a/ext/ftp/tests/ftp_get_option.phpt b/ext/ftp/tests/ftp_get_option.phpt index 336243d64b..13ed76fff1 100644 --- a/ext/ftp/tests/ftp_get_option.phpt +++ b/ext/ftp/tests/ftp_get_option.phpt @@ -28,4 +28,4 @@ try { int(%d) bool(true) bool(true) -ftp_get_option(): Argument #2 ($option) must be either FTP_TIMEOUT_SEC, FTP_AUTOSEEK, or FTP_USEPASVADDRESS +ftp_get_option(): Argument #2 ($option) must be one of FTP_TIMEOUT_SEC, FTP_AUTOSEEK, or FTP_USEPASVADDRESS diff --git a/ext/ftp/tests/ftp_set_option_errors.phpt b/ext/ftp/tests/ftp_set_option_errors.phpt index 03c387975e..3f5476f6c3 100644 --- a/ext/ftp/tests/ftp_set_option_errors.phpt +++ b/ext/ftp/tests/ftp_set_option_errors.phpt @@ -49,4 +49,4 @@ ftp_set_option(): Argument #3 ($value) must be greater than 0 for the FTP_TIMEOU ftp_set_option(): Argument #3 ($value) must be of type int for the FTP_TIMEOUT_SEC option, string given ftp_set_option(): Argument #3 ($value) must be of type bool for the FTP_USEPASVADDRESS option, array given ftp_set_option(): Argument #3 ($value) must be of type bool for the FTP_AUTOSEEK option, string given -ftp_set_option(): Argument #2 ($option) must be either FTP_TIMEOUT_SEC, FTP_AUTOSEEK, or FTP_USEPASVADDRESS +ftp_set_option(): Argument #2 ($option) must be one of FTP_TIMEOUT_SEC, FTP_AUTOSEEK, or FTP_USEPASVADDRESS diff --git a/ext/gd/gd.c b/ext/gd/gd.c index d425b83109..6f1ab3cf42 100644 --- a/ext/gd/gd.c +++ b/ext/gd/gd.c @@ -3521,7 +3521,7 @@ PHP_FUNCTION(imageflip) break; default: - zend_argument_value_error(2, "must be either IMG_FLIP_VERTICAL, IMG_FLIP_HORIZONTAL, or IMG_FLIP_BOTH"); + zend_argument_value_error(2, "must be one of IMG_FLIP_VERTICAL, IMG_FLIP_HORIZONTAL, or IMG_FLIP_BOTH"); RETURN_THROWS(); } diff --git a/ext/intl/grapheme/grapheme_string.c b/ext/intl/grapheme/grapheme_string.c index 8706381e58..e987c176e1 100644 --- a/ext/intl/grapheme/grapheme_string.c +++ b/ext/intl/grapheme/grapheme_string.c @@ -778,7 +778,7 @@ PHP_FUNCTION(grapheme_extract) } if ( extract_type < GRAPHEME_EXTRACT_TYPE_MIN || extract_type > GRAPHEME_EXTRACT_TYPE_MAX ) { - zend_argument_value_error(3, "must be either GRAPHEME_EXTR_COUNT, GRAPHEME_EXTR_MAXBYTES, or GRAPHEME_EXTR_MAXCHARS"); + zend_argument_value_error(3, "must be one of GRAPHEME_EXTR_COUNT, GRAPHEME_EXTR_MAXBYTES, or GRAPHEME_EXTR_MAXCHARS"); RETURN_THROWS(); } diff --git a/ext/intl/tests/bug62083.phpt b/ext/intl/tests/bug62083.phpt index 5b0f36e4f0..9896cea79f 100644 --- a/ext/intl/tests/bug62083.phpt +++ b/ext/intl/tests/bug62083.phpt @@ -14,4 +14,4 @@ try { } ?> --EXPECT-- -grapheme_extract(): Argument #3 ($extract_type) must be either GRAPHEME_EXTR_COUNT, GRAPHEME_EXTR_MAXBYTES, or GRAPHEME_EXTR_MAXCHARS +grapheme_extract(): Argument #3 ($extract_type) must be one of GRAPHEME_EXTR_COUNT, GRAPHEME_EXTR_MAXBYTES, or GRAPHEME_EXTR_MAXCHARS diff --git a/ext/ldap/ldap.c b/ext/ldap/ldap.c index 03926e5a07..a50882486a 100644 --- a/ext/ldap/ldap.c +++ b/ext/ldap/ldap.c @@ -2655,7 +2655,7 @@ PHP_FUNCTION(ldap_modify_batch) modtype != LDAP_MODIFY_BATCH_REPLACE && modtype != LDAP_MODIFY_BATCH_REMOVE_ALL ) { - zend_value_error("%s(): Option \"" LDAP_MODIFY_BATCH_MODTYPE "\" must be one of LDAP_MODIFY_BATCH_ADD, LDAP_MODIFY_BATCH_REMOVE, LDAP_MODIFY_BATCH_REPLACE, or LDAP_MODIFY_BATCH_REMOVE_ALL", get_active_function_name()); + zend_value_error("%s(): Option \"" LDAP_MODIFY_BATCH_MODTYPE "\" must be one of the LDAP_MODIFY_BATCH_* constants", get_active_function_name()); RETURN_THROWS(); } diff --git a/ext/mbstring/mbstring.c b/ext/mbstring/mbstring.c index 274feec35e..ba992af930 100644 --- a/ext/mbstring/mbstring.c +++ b/ext/mbstring/mbstring.c @@ -1307,7 +1307,7 @@ PHP_FUNCTION(mb_http_input) return; default: zend_argument_value_error(1, - "must be one of \"G\", \"P\", \"C\", \"S\", \"I\" or \"L\""); + "must be one of \"G\", \"P\", \"C\", \"S\", \"I\", or \"L\""); RETURN_THROWS(); } } @@ -2596,8 +2596,7 @@ PHP_FUNCTION(mb_convert_case) } if (case_mode < 0 || case_mode > PHP_UNICODE_CASE_MODE_MAX) { - zend_argument_value_error(2, "must be one of MB_CASE_UPPER, MB_CASE_LOWER, MB_CASE_TITLE, MB_CASE_FOLD," - " MB_CASE_UPPER_SIMPLE, MB_CASE_LOWER_SIMPLE, MB_CASE_TITLE_SIMPLE, or MB_CASE_FOLD_SIMPLE"); + zend_argument_value_error(2, "must be one of the MB_CASE_* constants"); RETURN_THROWS(); } diff --git a/ext/mbstring/tests/mb_convert_case_various_mode.phpt b/ext/mbstring/tests/mb_convert_case_various_mode.phpt index cd278ae52f..50653687aa 100644 --- a/ext/mbstring/tests/mb_convert_case_various_mode.phpt +++ b/ext/mbstring/tests/mb_convert_case_various_mode.phpt @@ -31,4 +31,4 @@ string(13) "FOO BAR SPAß" string(13) "foo bar spaß" string(13) "Foo Bar Spaß" string(13) "foo bar spaß" -mb_convert_case(): Argument #2 ($mode) must be one of MB_CASE_UPPER, MB_CASE_LOWER, MB_CASE_TITLE, MB_CASE_FOLD, MB_CASE_UPPER_SIMPLE, MB_CASE_LOWER_SIMPLE, MB_CASE_TITLE_SIMPLE, or MB_CASE_FOLD_SIMPLE +mb_convert_case(): Argument #2 ($mode) must be one of the MB_CASE_* constants diff --git a/ext/mbstring/tests/mb_http_input.phpt b/ext/mbstring/tests/mb_http_input.phpt index e6bb0528ec..d1fba60f3f 100644 --- a/ext/mbstring/tests/mb_http_input.phpt +++ b/ext/mbstring/tests/mb_http_input.phpt @@ -43,4 +43,4 @@ array(1) { string(10) "ISO-8859-1" } string(10) "ISO-8859-1" -mb_http_input(): Argument #1 ($type) must be one of "G", "P", "C", "S", "I" or "L" +mb_http_input(): Argument #1 ($type) must be one of "G", "P", "C", "S", "I", or "L" diff --git a/ext/mysqli/mysqli_api.c b/ext/mysqli/mysqli_api.c index 2263c75434..928031f82e 100644 --- a/ext/mysqli/mysqli_api.c +++ b/ext/mysqli/mysqli_api.c @@ -2270,8 +2270,7 @@ PHP_FUNCTION(mysqli_stmt_attr_set) case CURSOR_TYPE_SCROLLABLE: break; default: - zend_argument_value_error(ERROR_ARG_POS(3), "must be one of MYSQLI_CURSOR_TYPE_NO_CURSOR, " - "MYSQLI_CURSOR_TYPE_READ_ONLY, MYSQLI_CURSOR_TYPE_FOR_UPDATE, or MYSQLI_CURSOR_TYPE_SCROLLABLE " + zend_argument_value_error(ERROR_ARG_POS(3), "must be one of the MYSQLI_CURSOR_TYPE_* constants " "for attribute MYSQLI_STMT_ATTR_CURSOR_TYPE"); RETURN_THROWS(); } diff --git a/ext/mysqli/mysqli_nonapi.c b/ext/mysqli/mysqli_nonapi.c index 85c08c5b2f..5bbb1d3888 100644 --- a/ext/mysqli/mysqli_nonapi.c +++ b/ext/mysqli/mysqli_nonapi.c @@ -639,7 +639,7 @@ PHP_FUNCTION(mysqli_query) if ((resultmode & ~MYSQLI_ASYNC) != MYSQLI_USE_RESULT && MYSQLI_STORE_RESULT != (resultmode & ~(MYSQLI_ASYNC | MYSQLI_STORE_RESULT_COPY_DATA)) ) { - zend_argument_value_error(ERROR_ARG_POS(3), "must be either MYSQLI_USE_RESULT, or MYSQLI_STORE_RESULT" + zend_argument_value_error(ERROR_ARG_POS(3), "must be either MYSQLI_USE_RESULT or MYSQLI_STORE_RESULT" #ifdef MYSQLI_USE_MYSQLND " with MYSQLI_ASYNC as an optional bitmask flag" #endif diff --git a/ext/mysqli/tests/mysqli_query.phpt b/ext/mysqli/tests/mysqli_query.phpt index 90fc24cf9c..e2f6de3995 100644 --- a/ext/mysqli/tests/mysqli_query.phpt +++ b/ext/mysqli/tests/mysqli_query.phpt @@ -125,6 +125,6 @@ array(1) { string(1) "a" } string(1) "a" -mysqli_query(): Argument #3 ($result_mode) must be either MYSQLI_USE_RESULT, or MYSQLI_STORE_RESULT%S +mysqli_query(): Argument #3 ($result_mode) must be either MYSQLI_USE_RESULT or MYSQLI_STORE_RESULT%S mysqli object is already closed done! diff --git a/ext/mysqli/tests/mysqli_stmt_attr_set.phpt b/ext/mysqli/tests/mysqli_stmt_attr_set.phpt index 16d789f37f..40018305ca 100644 --- a/ext/mysqli/tests/mysqli_stmt_attr_set.phpt +++ b/ext/mysqli/tests/mysqli_stmt_attr_set.phpt @@ -245,6 +245,6 @@ Error: mysqli_stmt object is not fully initialized mysqli_stmt_attr_set(): Argument #2 ($attr) must be one of MYSQLI_STMT_ATTR_UPDATE_MAX_LENGTH, MYSQLI_STMT_ATTR_PREFETCH_ROWS, or STMT_ATTR_CURSOR_TYPE mysqli_stmt::attr_set(): Argument #2 ($mode_in) must be 0 or 1 for attribute MYSQLI_STMT_ATTR_UPDATE_MAX_LENGTH bool(true) -mysqli_stmt::attr_set(): Argument #2 ($mode_in) must be one of MYSQLI_CURSOR_TYPE_NO_CURSOR, MYSQLI_CURSOR_TYPE_READ_ONLY, MYSQLI_CURSOR_TYPE_FOR_UPDATE, or MYSQLI_CURSOR_TYPE_SCROLLABLE for attribute MYSQLI_STMT_ATTR_CURSOR_TYPE +mysqli_stmt::attr_set(): Argument #2 ($mode_in) must be one of the MYSQLI_CURSOR_TYPE_* constants for attribute MYSQLI_STMT_ATTR_CURSOR_TYPE mysqli_stmt::attr_set(): Argument #2 ($mode_in) must be greater than 0 for attribute MYSQLI_STMT_ATTR_PREFETCH_ROWS done! diff --git a/ext/pdo_odbc/pdo_odbc.c b/ext/pdo_odbc/pdo_odbc.c index d0c2f913ff..21654d4062 100644 --- a/ext/pdo_odbc/pdo_odbc.c +++ b/ext/pdo_odbc/pdo_odbc.c @@ -87,7 +87,7 @@ PHP_MINIT_FUNCTION(pdo_odbc) } else if (*pooling_val == '\0' || strcasecmp(pooling_val, "off") == 0) { pdo_odbc_pool_on = SQL_CP_OFF; } else { - php_error_docref(NULL, E_CORE_ERROR, "Error in pdo_odbc.connection_pooling configuration. Value MUST be one of 'strict', 'relaxed' or 'off'"); + php_error_docref(NULL, E_CORE_ERROR, "Error in pdo_odbc.connection_pooling configuration. Value must be one of \"strict\", \"relaxed\", or \"off\""); return FAILURE; } diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 292e1901e4..470b52e6c7 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -2320,7 +2320,7 @@ ZEND_METHOD(ReflectionParameter, __construct) break; default: - zend_argument_error(reflection_exception_ptr, 1, "must be either a string, an array(class, method) or a callable object, %s given", zend_zval_type_name(reference)); + zend_argument_error(reflection_exception_ptr, 1, "must be a string, an array(class, method), or a callable object, %s given", zend_zval_type_name(reference)); RETURN_THROWS(); } diff --git a/ext/reflection/tests/ReflectionParameter_invalidMethodInConstructor.phpt b/ext/reflection/tests/ReflectionParameter_invalidMethodInConstructor.phpt index 917f079fd9..aa88c45449 100644 --- a/ext/reflection/tests/ReflectionParameter_invalidMethodInConstructor.phpt +++ b/ext/reflection/tests/ReflectionParameter_invalidMethodInConstructor.phpt @@ -44,5 +44,5 @@ Class "A" does not exist Method C::b() does not exist Method C::b() does not exist Ok - ReflectionParameter::__construct() expects exactly 2 arguments, 1 given -Ok - ReflectionParameter::__construct(): Argument #1 ($function) must be either a string, an array(class, method) or a callable object, int given +Ok - ReflectionParameter::__construct(): Argument #1 ($function) must be a string, an array(class, method), or a callable object, int given Done. diff --git a/ext/snmp/snmp.c b/ext/snmp/snmp.c index 5eb8d0b338..0ca49fc208 100644 --- a/ext/snmp/snmp.c +++ b/ext/snmp/snmp.c @@ -941,7 +941,7 @@ static int netsnmp_session_set_auth_protocol(struct snmp_session *s, char *prot) s->securityAuthProto = usmHMACSHA1AuthProtocol; s->securityAuthProtoLen = USM_AUTH_PROTO_SHA_LEN; } else { - zend_value_error("Authentication protocol must be either MD5 or SHA"); + zend_value_error("Authentication protocol must be either \"MD5\" or \"SHA\""); return (-1); } return (0); @@ -962,9 +962,9 @@ static int netsnmp_session_set_sec_protocol(struct snmp_session *s, char *prot) #endif } else { #ifdef HAVE_AES - zend_value_error("Security protocol must be one of DES, AES128, or AES"); + zend_value_error("Security protocol must be one of \"DES\", \"AES128\", or \"AES\""); #else - zend_value_error("Security protocol must be DES"); + zend_value_error("Security protocol must be \"DES\""); #endif return (-1); } diff --git a/ext/snmp/tests/snmp-object-setSecurity_error.phpt b/ext/snmp/tests/snmp-object-setSecurity_error.phpt index b0bf03bd3d..7d5f1912da 100644 --- a/ext/snmp/tests/snmp-object-setSecurity_error.phpt +++ b/ext/snmp/tests/snmp-object-setSecurity_error.phpt @@ -59,15 +59,15 @@ var_dump($session->close()); --EXPECTF-- Security level must be one of "noAuthNoPriv", "authNoPriv", or "authPriv" Security level must be one of "noAuthNoPriv", "authNoPriv", or "authPriv" -Authentication protocol must be either MD5 or SHA +Authentication protocol must be either "MD5" or "SHA" Warning: SNMP::setSecurity(): Error generating a key for authentication pass phrase '': Generic error (The supplied password length is too short.) in %s on line %d bool(false) Warning: SNMP::setSecurity(): Error generating a key for authentication pass phrase 'te': Generic error (The supplied password length is too short.) in %s on line %d bool(false) -Security protocol must be one of DES, AES128, or AES -Security protocol must be one of DES, AES128, or AES +Security protocol must be one of "DES", "AES128", or "AES" +Security protocol must be one of "DES", "AES128", or "AES" Warning: SNMP::setSecurity(): Error generating a key for privacy pass phrase '': Generic error (The supplied password length is too short.) in %s on line %d bool(false) diff --git a/ext/snmp/tests/snmp3-error.phpt b/ext/snmp/tests/snmp3-error.phpt index 7c07d13fa9..20b4ede70e 100644 --- a/ext/snmp/tests/snmp3-error.phpt +++ b/ext/snmp/tests/snmp3-error.phpt @@ -58,14 +58,14 @@ try { Checking error handling Security level must be one of "noAuthNoPriv", "authNoPriv", or "authPriv" Security level must be one of "noAuthNoPriv", "authNoPriv", or "authPriv" -Authentication protocol must be either MD5 or SHA +Authentication protocol must be either "MD5" or "SHA" Warning: snmp3_get(): Error generating a key for authentication pass phrase '': Generic error (The supplied password length is too short.) in %s on line %d bool(false) Warning: snmp3_get(): Error generating a key for authentication pass phrase 'te': Generic error (The supplied password length is too short.) in %s on line %d bool(false) -Security protocol must be one of DES, AES128, or AES +Security protocol must be one of "DES", "AES128", or "AES" Warning: snmp3_get(): Error generating a key for privacy pass phrase '': Generic error (The supplied password length is too short.) in %s on line %d bool(false) diff --git a/ext/soap/soap.c b/ext/soap/soap.c index 446436db5f..b79a6f531c 100644 --- a/ext/soap/soap.c +++ b/ext/soap/soap.c @@ -587,7 +587,7 @@ PHP_METHOD(SoapHeader, __construct) if ((actor_long == SOAP_ACTOR_NEXT || actor_long == SOAP_ACTOR_NONE || actor_long == SOAP_ACTOR_UNLIMATERECEIVER)) { add_property_long(this_ptr, "actor", actor_long); } else { - zend_argument_value_error(5, "must be either SOAP_ACTOR_NEXT, SOAP_ACTOR_NONE or SOAP_ACTOR_UNLIMATERECEIVER"); + zend_argument_value_error(5, "must be one of SOAP_ACTOR_NEXT, SOAP_ACTOR_NONE, or SOAP_ACTOR_UNLIMATERECEIVER"); RETURN_THROWS(); } } diff --git a/ext/sockets/sockets.c b/ext/sockets/sockets.c index 21c107adec..729477ab59 100644 --- a/ext/sockets/sockets.c +++ b/ext/sockets/sockets.c @@ -1137,7 +1137,7 @@ PHP_FUNCTION(socket_getsockname) break; default: - zend_argument_value_error(1, "must be either AF_UNIX, AF_INET, or AF_INET6"); + zend_argument_value_error(1, "must be one of AF_UNIX, AF_INET, or AF_INET6"); RETURN_THROWS(); } } @@ -1212,7 +1212,7 @@ PHP_FUNCTION(socket_getpeername) break; default: - zend_argument_value_error(1, "must be either AF_UNIX, AF_INET, or AF_INET6"); + zend_argument_value_error(1, "must be one of AF_UNIX, AF_INET, or AF_INET6"); RETURN_THROWS(); } } @@ -1233,12 +1233,12 @@ PHP_FUNCTION(socket_create) && domain != AF_INET6 #endif && domain != AF_INET) { - zend_argument_value_error(1, "must be either AF_UNIX, AF_INET6, or AF_INET"); + zend_argument_value_error(1, "must be one of AF_UNIX, AF_INET6, or AF_INET"); RETURN_THROWS(); } if (type > 10) { - zend_argument_value_error(2, "must be either SOCK_STREAM, SOCK_DGRAM, SOCK_SEQPACKET," + zend_argument_value_error(2, "must be one of SOCK_STREAM, SOCK_DGRAM, SOCK_SEQPACKET," " SOCK_RAW, or SOCK_RDM"); RETURN_THROWS(); } @@ -1337,7 +1337,7 @@ PHP_FUNCTION(socket_connect) } default: - zend_argument_value_error(1, "must be either AF_UNIX, AF_INET, or AF_INET6"); + zend_argument_value_error(1, "must be one of AF_UNIX, AF_INET, or AF_INET6"); RETURN_THROWS(); } @@ -1431,7 +1431,7 @@ PHP_FUNCTION(socket_bind) } #endif default: - zend_argument_value_error(1, "must be either AF_UNIX, AF_INET, or AF_INET6"); + zend_argument_value_error(1, "must be one of AF_UNIX, AF_INET, or AF_INET6"); RETURN_THROWS(); } @@ -1625,7 +1625,7 @@ PHP_FUNCTION(socket_recvfrom) break; #endif default: - zend_argument_value_error(1, "must be either AF_UNIX, AF_INET, or AF_INET6"); + zend_argument_value_error(1, "must be one of AF_UNIX, AF_INET, or AF_INET6"); RETURN_THROWS(); } @@ -1705,7 +1705,7 @@ PHP_FUNCTION(socket_sendto) break; #endif default: - zend_argument_value_error(1, "must be either AF_UNIX, AF_INET, or AF_INET6"); + zend_argument_value_error(1, "must be one of AF_UNIX, AF_INET, or AF_INET6"); RETURN_THROWS(); } @@ -1987,12 +1987,12 @@ PHP_FUNCTION(socket_create_pair) && domain != AF_INET6 #endif && domain != AF_UNIX) { - zend_argument_value_error(1, "must be either AF_UNIX, AF_INET6 or AF_INET"); + zend_argument_value_error(1, "must be one of AF_UNIX, AF_INET6, or AF_INET"); RETURN_THROWS(); } if (type > 10) { - zend_argument_value_error(2, "must be either SOCK_STREAM, SOCK_DGRAM, SOCK_SEQPACKET," + zend_argument_value_error(2, "must be one of SOCK_STREAM, SOCK_DGRAM, SOCK_SEQPACKET," " SOCK_RAW, or SOCK_RDM"); RETURN_THROWS(); } @@ -2402,7 +2402,7 @@ PHP_FUNCTION(socket_addrinfo_bind) default: close(php_sock->bsd_socket); zval_ptr_dtor(return_value); - zend_argument_value_error(1, "must be either AF_UNIX, AF_INET, or AF_INET6"); + zend_argument_value_error(1, "must be one of AF_UNIX, AF_INET, or AF_INET6"); RETURN_THROWS(); } @@ -2463,7 +2463,7 @@ PHP_FUNCTION(socket_addrinfo_connect) break; } default: - zend_argument_value_error(1, "socket type must be either AF_UNIX, AF_INET, or AF_INET6"); + zend_argument_value_error(1, "socket type must be one of AF_UNIX, AF_INET, or AF_INET6"); close(php_sock->bsd_socket); zval_ptr_dtor(return_value); RETURN_THROWS(); diff --git a/ext/sockets/tests/socket_create_pair-wrongparams-win32.phpt b/ext/sockets/tests/socket_create_pair-wrongparams-win32.phpt index 1abab2a1e7..ff4dd5de06 100644 --- a/ext/sockets/tests/socket_create_pair-wrongparams-win32.phpt +++ b/ext/sockets/tests/socket_create_pair-wrongparams-win32.phpt @@ -27,8 +27,8 @@ try { ?> --EXPECT-- bool(true) -socket_create_pair(): Argument #1 ($domain) must be either AF_UNIX, AF_INET6 or AF_INET -socket_create_pair(): Argument #2 ($type) must be either SOCK_STREAM, SOCK_DGRAM, SOCK_SEQPACKET, SOCK_RAW, or SOCK_RDM +socket_create_pair(): Argument #1 ($domain) must be one of AF_UNIX, AF_INET6, or AF_INET +socket_create_pair(): Argument #2 ($type) must be one of SOCK_STREAM, SOCK_DGRAM, SOCK_SEQPACKET, SOCK_RAW, or SOCK_RDM --CREDITS-- Till Klampaeckel, till@php.net Berlin TestFest 2009 diff --git a/ext/sockets/tests/socket_create_pair-wrongparams.phpt b/ext/sockets/tests/socket_create_pair-wrongparams.phpt index 8dc56d1e36..57111c83f1 100644 --- a/ext/sockets/tests/socket_create_pair-wrongparams.phpt +++ b/ext/sockets/tests/socket_create_pair-wrongparams.phpt @@ -29,8 +29,8 @@ try { --EXPECTF-- Warning: socket_create_pair(): Unable to create socket pair [%d]: %s not supported in %s on line %d bool(false) -socket_create_pair(): Argument #1 ($domain) must be either AF_UNIX, AF_INET6 or AF_INET -socket_create_pair(): Argument #2 ($type) must be either SOCK_STREAM, SOCK_DGRAM, SOCK_SEQPACKET, SOCK_RAW, or SOCK_RDM +socket_create_pair(): Argument #1 ($domain) must be one of AF_UNIX, AF_INET6, or AF_INET +socket_create_pair(): Argument #2 ($type) must be one of SOCK_STREAM, SOCK_DGRAM, SOCK_SEQPACKET, SOCK_RAW, or SOCK_RDM --CREDITS-- Till Klampaeckel, till@php.net Berlin TestFest 2009 diff --git a/ext/standard/file.c b/ext/standard/file.c index 224e69ffdd..458b66432b 100644 --- a/ext/standard/file.c +++ b/ext/standard/file.c @@ -333,7 +333,7 @@ PHPAPI void php_flock_common(php_stream *stream, zend_long operation, act = operation & PHP_LOCK_UN; if (act < 1 || act > 3) { - zend_argument_value_error(operation_arg_num, "must be either LOCK_SH, LOCK_EX, or LOCK_UN"); + zend_argument_value_error(operation_arg_num, "must be one of LOCK_SH, LOCK_EX, or LOCK_UN"); RETURN_THROWS(); } diff --git a/ext/standard/tests/file/flock.phpt b/ext/standard/tests/file/flock.phpt index 68e0f3fd30..346029c7ca 100644 --- a/ext/standard/tests/file/flock.phpt +++ b/ext/standard/tests/file/flock.phpt @@ -60,4 +60,4 @@ int(0) bool(true) int(0) bool(true) -flock(): Argument #2 ($operation) must be either LOCK_SH, LOCK_EX, or LOCK_UN +flock(): Argument #2 ($operation) must be one of LOCK_SH, LOCK_EX, or LOCK_UN diff --git a/ext/standard/tests/file/flock_error.phpt b/ext/standard/tests/file/flock_error.phpt index 52dd5179be..add2295981 100644 --- a/ext/standard/tests/file/flock_error.phpt +++ b/ext/standard/tests/file/flock_error.phpt @@ -56,13 +56,13 @@ unlink($file); --EXPECT-- *** Testing error conditions *** --- Iteration 0 --- -flock(): Argument #2 ($operation) must be either LOCK_SH, LOCK_EX, or LOCK_UN +flock(): Argument #2 ($operation) must be one of LOCK_SH, LOCK_EX, or LOCK_UN --- Iteration 1 --- -flock(): Argument #2 ($operation) must be either LOCK_SH, LOCK_EX, or LOCK_UN +flock(): Argument #2 ($operation) must be one of LOCK_SH, LOCK_EX, or LOCK_UN --- Iteration 2 --- -flock(): Argument #2 ($operation) must be either LOCK_SH, LOCK_EX, or LOCK_UN +flock(): Argument #2 ($operation) must be one of LOCK_SH, LOCK_EX, or LOCK_UN --- Iteration 3 --- -flock(): Argument #2 ($operation) must be either LOCK_SH, LOCK_EX, or LOCK_UN +flock(): Argument #2 ($operation) must be one of LOCK_SH, LOCK_EX, or LOCK_UN --- Iteration 4 --- flock(): Argument #2 ($operation) must be of type int, array given --- Iteration 5 --- diff --git a/ext/zlib/tests/007.phpt b/ext/zlib/tests/007.phpt index b9255557ff..6783b44f4d 100644 --- a/ext/zlib/tests/007.phpt +++ b/ext/zlib/tests/007.phpt @@ -42,9 +42,9 @@ var_dump(gzencode($string, 9, ZLIB_ENCODING_DEFLATE)); --EXPECTF-- gzencode(): Argument #2 ($level) must be between -1 and 9 gzencode(): Argument #2 ($level) must be between -1 and 9 -gzencode(): Argument #3 ($encoding) must be either ZLIB_ENCODING_RAW, ZLIB_ENCODING_GZIP, or ZLIB_ENCODING_DEFLATE +gzencode(): Argument #3 ($encoding) must be one of ZLIB_ENCODING_RAW, ZLIB_ENCODING_GZIP, or ZLIB_ENCODING_DEFLATE string(%d) "%a" string(%d) "%a" -gzencode(): Argument #3 ($encoding) must be either ZLIB_ENCODING_RAW, ZLIB_ENCODING_GZIP, or ZLIB_ENCODING_DEFLATE +gzencode(): Argument #3 ($encoding) must be one of ZLIB_ENCODING_RAW, ZLIB_ENCODING_GZIP, or ZLIB_ENCODING_DEFLATE string(%d) "%a" string(%d) "%a" diff --git a/ext/zlib/tests/deflate_init_error.phpt b/ext/zlib/tests/deflate_init_error.phpt index b31a16be9a..104d8552e3 100644 --- a/ext/zlib/tests/deflate_init_error.phpt +++ b/ext/zlib/tests/deflate_init_error.phpt @@ -41,7 +41,7 @@ try { ?> --EXPECT-- -deflate_init(): Argument #1 ($encoding) must be either ZLIB_ENCODING_RAW, ZLIB_ENCODING_GZIP, or ZLIB_ENCODING_DEFLATE +deflate_init(): Argument #1 ($encoding) must be one of ZLIB_ENCODING_RAW, ZLIB_ENCODING_GZIP, or ZLIB_ENCODING_DEFLATE deflate_init(): "level" option must be between -1 and 9 deflate_init(): "level" option must be between -1 and 9 deflate_init(): "memory" option must be between 1 and 9 diff --git a/ext/zlib/tests/gzcompress_error1.phpt b/ext/zlib/tests/gzcompress_error1.phpt index ff09d6568a..e740de6d0c 100644 --- a/ext/zlib/tests/gzcompress_error1.phpt +++ b/ext/zlib/tests/gzcompress_error1.phpt @@ -41,4 +41,4 @@ try { gzcompress(): Argument #2 ($level) must be between -1 and 9 -- Testing with invalid encoding -- -gzcompress(): Argument #3 ($encoding) must be either ZLIB_ENCODING_RAW, ZLIB_ENCODING_GZIP, or ZLIB_ENCODING_DEFLATE +gzcompress(): Argument #3 ($encoding) must be one of ZLIB_ENCODING_RAW, ZLIB_ENCODING_GZIP, or ZLIB_ENCODING_DEFLATE diff --git a/ext/zlib/tests/gzdeflate_error1.phpt b/ext/zlib/tests/gzdeflate_error1.phpt index fea4dfec00..5081f66dc4 100644 --- a/ext/zlib/tests/gzdeflate_error1.phpt +++ b/ext/zlib/tests/gzdeflate_error1.phpt @@ -41,4 +41,4 @@ try { gzdeflate(): Argument #2 ($level) must be between -1 and 9 -- Testing with incorrect encoding -- -gzdeflate(): Argument #3 ($encoding) must be either ZLIB_ENCODING_RAW, ZLIB_ENCODING_GZIP, or ZLIB_ENCODING_DEFLATE +gzdeflate(): Argument #3 ($encoding) must be one of ZLIB_ENCODING_RAW, ZLIB_ENCODING_GZIP, or ZLIB_ENCODING_DEFLATE diff --git a/ext/zlib/tests/gzencode_error1.phpt b/ext/zlib/tests/gzencode_error1.phpt index 951437b98a..00d70f9398 100644 --- a/ext/zlib/tests/gzencode_error1.phpt +++ b/ext/zlib/tests/gzencode_error1.phpt @@ -42,4 +42,4 @@ try { gzencode(): Argument #2 ($level) must be between -1 and 9 -- Testing with incorrect encoding_mode -- -gzencode(): Argument #3 ($encoding) must be either ZLIB_ENCODING_RAW, ZLIB_ENCODING_GZIP, or ZLIB_ENCODING_DEFLATE +gzencode(): Argument #3 ($encoding) must be one of ZLIB_ENCODING_RAW, ZLIB_ENCODING_GZIP, or ZLIB_ENCODING_DEFLATE diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c index 6ddda3d7a2..eab3b02ca5 100644 --- a/ext/zlib/zlib.c +++ b/ext/zlib/zlib.c @@ -725,7 +725,7 @@ PHP_FUNCTION(name) \ case PHP_ZLIB_ENCODING_DEFLATE: \ break; \ default: \ - zend_argument_value_error(default_encoding ? 3 : 2, "must be either ZLIB_ENCODING_RAW, ZLIB_ENCODING_GZIP, or ZLIB_ENCODING_DEFLATE"); \ + zend_argument_value_error(default_encoding ? 3 : 2, "must be one of ZLIB_ENCODING_RAW, ZLIB_ENCODING_GZIP, or ZLIB_ENCODING_DEFLATE"); \ RETURN_THROWS(); \ } \ if ((out = php_zlib_encode(ZSTR_VAL(in), ZSTR_LEN(in), encoding, level)) == NULL) { \ @@ -1129,7 +1129,7 @@ PHP_FUNCTION(deflate_init) case Z_DEFAULT_STRATEGY: break; default: - zend_value_error("deflate_init(): \"strategy\" option must be one of ZLIB_FILTERED, ZLIB_HUFFMAN_ONLY, ZLIB_RLE, ZLIB_FIXED or ZLIB_DEFAULT_STRATEGY"); + zend_value_error("deflate_init(): \"strategy\" option must be one of ZLIB_FILTERED, ZLIB_HUFFMAN_ONLY, ZLIB_RLE, ZLIB_FIXED, or ZLIB_DEFAULT_STRATEGY"); RETURN_THROWS(); } @@ -1143,7 +1143,7 @@ PHP_FUNCTION(deflate_init) case PHP_ZLIB_ENCODING_DEFLATE: break; default: - zend_argument_value_error(1, "must be either ZLIB_ENCODING_RAW, ZLIB_ENCODING_GZIP, or ZLIB_ENCODING_DEFLATE"); + zend_argument_value_error(1, "must be one of ZLIB_ENCODING_RAW, ZLIB_ENCODING_GZIP, or ZLIB_ENCODING_DEFLATE"); RETURN_THROWS(); } diff --git a/sapi/phpdbg/phpdbg.c b/sapi/phpdbg/phpdbg.c index 54d06a84c7..efd2270601 100644 --- a/sapi/phpdbg/phpdbg.c +++ b/sapi/phpdbg/phpdbg.c @@ -438,7 +438,7 @@ PHP_FUNCTION(phpdbg_color) break; default: - zend_argument_value_error(1, "must be either PHPDBG_COLOR_PROMPT, PHPDBG_COLOR_NOTICE, or PHPDBG_COLOR_ERROR"); + zend_argument_value_error(1, "must be one of PHPDBG_COLOR_PROMPT, PHPDBG_COLOR_NOTICE, or PHPDBG_COLOR_ERROR"); } } /* }}} */ -- 2.50.0