Skip to content

Commit e950ca1

Browse files
committed
Consolidate the usage of "either" and "one of" in error messages
Closes GH-6173
1 parent c0f8cc1 commit e950ca1

34 files changed

+60
-62
lines changed

ext/ftp/php_ftp.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1284,7 +1284,7 @@ PHP_FUNCTION(ftp_set_option)
12841284
RETURN_TRUE;
12851285
break;
12861286
default:
1287-
zend_argument_value_error(2, "must be either FTP_TIMEOUT_SEC, FTP_AUTOSEEK, or FTP_USEPASVADDRESS");
1287+
zend_argument_value_error(2, "must be one of FTP_TIMEOUT_SEC, FTP_AUTOSEEK, or FTP_USEPASVADDRESS");
12881288
RETURN_THROWS();
12891289
break;
12901290
}
@@ -1317,7 +1317,7 @@ PHP_FUNCTION(ftp_get_option)
13171317
RETURN_BOOL(ftp->usepasvaddress);
13181318
break;
13191319
default:
1320-
zend_argument_value_error(2, "must be either FTP_TIMEOUT_SEC, FTP_AUTOSEEK, or FTP_USEPASVADDRESS");
1320+
zend_argument_value_error(2, "must be one of FTP_TIMEOUT_SEC, FTP_AUTOSEEK, or FTP_USEPASVADDRESS");
13211321
RETURN_THROWS();
13221322
}
13231323
}

ext/ftp/tests/ftp_get_option.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ try {
2828
int(%d)
2929
bool(true)
3030
bool(true)
31-
ftp_get_option(): Argument #2 ($option) must be either FTP_TIMEOUT_SEC, FTP_AUTOSEEK, or FTP_USEPASVADDRESS
31+
ftp_get_option(): Argument #2 ($option) must be one of FTP_TIMEOUT_SEC, FTP_AUTOSEEK, or FTP_USEPASVADDRESS

ext/ftp/tests/ftp_set_option_errors.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,4 @@ ftp_set_option(): Argument #3 ($value) must be greater than 0 for the FTP_TIMEOU
4949
ftp_set_option(): Argument #3 ($value) must be of type int for the FTP_TIMEOUT_SEC option, string given
5050
ftp_set_option(): Argument #3 ($value) must be of type bool for the FTP_USEPASVADDRESS option, array given
5151
ftp_set_option(): Argument #3 ($value) must be of type bool for the FTP_AUTOSEEK option, string given
52-
ftp_set_option(): Argument #2 ($option) must be either FTP_TIMEOUT_SEC, FTP_AUTOSEEK, or FTP_USEPASVADDRESS
52+
ftp_set_option(): Argument #2 ($option) must be one of FTP_TIMEOUT_SEC, FTP_AUTOSEEK, or FTP_USEPASVADDRESS

ext/gd/gd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3521,7 +3521,7 @@ PHP_FUNCTION(imageflip)
35213521
break;
35223522

35233523
default:
3524-
zend_argument_value_error(2, "must be either IMG_FLIP_VERTICAL, IMG_FLIP_HORIZONTAL, or IMG_FLIP_BOTH");
3524+
zend_argument_value_error(2, "must be one of IMG_FLIP_VERTICAL, IMG_FLIP_HORIZONTAL, or IMG_FLIP_BOTH");
35253525
RETURN_THROWS();
35263526
}
35273527

ext/intl/grapheme/grapheme_string.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -778,7 +778,7 @@ PHP_FUNCTION(grapheme_extract)
778778
}
779779

780780
if ( extract_type < GRAPHEME_EXTRACT_TYPE_MIN || extract_type > GRAPHEME_EXTRACT_TYPE_MAX ) {
781-
zend_argument_value_error(3, "must be either GRAPHEME_EXTR_COUNT, GRAPHEME_EXTR_MAXBYTES, or GRAPHEME_EXTR_MAXCHARS");
781+
zend_argument_value_error(3, "must be one of GRAPHEME_EXTR_COUNT, GRAPHEME_EXTR_MAXBYTES, or GRAPHEME_EXTR_MAXCHARS");
782782
RETURN_THROWS();
783783
}
784784

ext/intl/tests/bug62083.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ try {
1414
}
1515
?>
1616
--EXPECT--
17-
grapheme_extract(): Argument #3 ($extract_type) must be either GRAPHEME_EXTR_COUNT, GRAPHEME_EXTR_MAXBYTES, or GRAPHEME_EXTR_MAXCHARS
17+
grapheme_extract(): Argument #3 ($extract_type) must be one of GRAPHEME_EXTR_COUNT, GRAPHEME_EXTR_MAXBYTES, or GRAPHEME_EXTR_MAXCHARS

ext/ldap/ldap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2655,7 +2655,7 @@ PHP_FUNCTION(ldap_modify_batch)
26552655
modtype != LDAP_MODIFY_BATCH_REPLACE &&
26562656
modtype != LDAP_MODIFY_BATCH_REMOVE_ALL
26572657
) {
2658-
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());
2658+
zend_value_error("%s(): Option \"" LDAP_MODIFY_BATCH_MODTYPE "\" must be one of the LDAP_MODIFY_BATCH_* constants", get_active_function_name());
26592659
RETURN_THROWS();
26602660
}
26612661

ext/mbstring/mbstring.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1307,7 +1307,7 @@ PHP_FUNCTION(mb_http_input)
13071307
return;
13081308
default:
13091309
zend_argument_value_error(1,
1310-
"must be one of \"G\", \"P\", \"C\", \"S\", \"I\" or \"L\"");
1310+
"must be one of \"G\", \"P\", \"C\", \"S\", \"I\", or \"L\"");
13111311
RETURN_THROWS();
13121312
}
13131313
}
@@ -2596,8 +2596,7 @@ PHP_FUNCTION(mb_convert_case)
25962596
}
25972597

25982598
if (case_mode < 0 || case_mode > PHP_UNICODE_CASE_MODE_MAX) {
2599-
zend_argument_value_error(2, "must be one of MB_CASE_UPPER, MB_CASE_LOWER, MB_CASE_TITLE, MB_CASE_FOLD,"
2600-
" MB_CASE_UPPER_SIMPLE, MB_CASE_LOWER_SIMPLE, MB_CASE_TITLE_SIMPLE, or MB_CASE_FOLD_SIMPLE");
2599+
zend_argument_value_error(2, "must be one of the MB_CASE_* constants");
26012600
RETURN_THROWS();
26022601
}
26032602

ext/mbstring/tests/mb_convert_case_various_mode.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ string(13) "FOO BAR SPAß"
3131
string(13) "foo bar spaß"
3232
string(13) "Foo Bar Spaß"
3333
string(13) "foo bar spaß"
34-
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
34+
mb_convert_case(): Argument #2 ($mode) must be one of the MB_CASE_* constants

ext/mbstring/tests/mb_http_input.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,4 @@ array(1) {
4343
string(10) "ISO-8859-1"
4444
}
4545
string(10) "ISO-8859-1"
46-
mb_http_input(): Argument #1 ($type) must be one of "G", "P", "C", "S", "I" or "L"
46+
mb_http_input(): Argument #1 ($type) must be one of "G", "P", "C", "S", "I", or "L"

0 commit comments

Comments
 (0)