Skip to content

Commit c823ee4

Browse files
committed
Use "must not" instead of "cannot" wording
1 parent 6075d96 commit c823ee4

File tree

157 files changed

+281
-281
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

157 files changed

+281
-281
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
--TEST--
2-
Property hook list cannot be empty
2+
Property hook list must not be empty
33
--FILE--
44
<?php
55

@@ -9,4 +9,4 @@ class Test {
99

1010
?>
1111
--EXPECTF--
12-
Fatal error: Property hook list cannot be empty in %s on line %d
12+
Fatal error: Property hook list must not be empty in %s on line %d

Zend/zend_API.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -439,9 +439,9 @@ ZEND_API ZEND_COLD void zend_argument_value_error(uint32_t arg_num, const char *
439439
}
440440
/* }}} */
441441

442-
ZEND_API ZEND_COLD void zend_argument_cannot_be_empty_error(uint32_t arg_num)
442+
ZEND_API ZEND_COLD void zend_argument_must_not_be_empty_error(uint32_t arg_num)
443443
{
444-
zend_argument_value_error(arg_num, "cannot be empty");
444+
zend_argument_value_error(arg_num, "must not be empty");
445445
}
446446

447447
ZEND_API ZEND_COLD void zend_class_redeclaration_error_ex(int type, zend_string *new_name, zend_class_entry *old_ce)

Zend/zend_API.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1564,7 +1564,7 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_argument_error_variadic(zend_class_en
15641564
ZEND_API ZEND_COLD void zend_argument_error(zend_class_entry *error_ce, uint32_t arg_num, const char *format, ...);
15651565
ZEND_API ZEND_COLD void zend_argument_type_error(uint32_t arg_num, const char *format, ...);
15661566
ZEND_API ZEND_COLD void zend_argument_value_error(uint32_t arg_num, const char *format, ...);
1567-
ZEND_API ZEND_COLD void zend_argument_cannot_be_empty_error(uint32_t arg_num);
1567+
ZEND_API ZEND_COLD void zend_argument_must_not_be_empty_error(uint32_t arg_num);
15681568
ZEND_API ZEND_COLD void zend_class_redeclaration_error(int type, zend_class_entry *old_ce);
15691569
ZEND_API ZEND_COLD void zend_class_redeclaration_error_ex(int type, zend_string *new_name, zend_class_entry *old_ce);
15701570

Zend/zend_compile.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8383,7 +8383,7 @@ static void zend_compile_property_hooks(
83838383
zend_class_entry *ce = CG(active_class_entry);
83848384

83858385
if (hooks->children == 0) {
8386-
zend_error_noreturn(E_COMPILE_ERROR, "Property hook list cannot be empty");
8386+
zend_error_noreturn(E_COMPILE_ERROR, "Property hook list must not be empty");
83878387
}
83888388

83898389
for (uint32_t i = 0; i < hooks->children; i++) {

ext/bz2/bz2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ PHP_FUNCTION(bzopen)
349349
/* If it's not a resource its a string containing the filename to open */
350350
if (Z_TYPE_P(file) == IS_STRING) {
351351
if (Z_STRLEN_P(file) == 0) {
352-
zend_argument_cannot_be_empty_error(1);
352+
zend_argument_must_not_be_empty_error(1);
353353
RETURN_THROWS();
354354
}
355355

ext/bz2/tests/001.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ var_dump(bzopen($fp, "r"));
4242

4343
?>
4444
--EXPECTF--
45-
bzopen(): Argument #1 ($file) cannot be empty
46-
bzopen(): Argument #1 ($file) cannot be empty
45+
bzopen(): Argument #1 ($file) must not be empty
46+
bzopen(): Argument #1 ($file) must not be empty
4747
bzopen(): Argument #2 ($mode) must be either "r" or "w"
4848
bzopen(): Argument #2 ($mode) must be either "r" or "w"
4949
bzopen(): Argument #2 ($mode) must be either "r" or "w"

ext/dba/dba.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -547,15 +547,15 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, bool persistent)
547547
}
548548

549549
if (ZSTR_LEN(path) == 0) {
550-
zend_argument_cannot_be_empty_error(1);
550+
zend_argument_must_not_be_empty_error(1);
551551
RETURN_THROWS();
552552
}
553553
if (ZSTR_LEN(mode) == 0) {
554-
zend_argument_cannot_be_empty_error(2);
554+
zend_argument_must_not_be_empty_error(2);
555555
RETURN_THROWS();
556556
}
557557
if (handler_str && ZSTR_LEN(handler_str) == 0) {
558-
zend_argument_cannot_be_empty_error(3);
558+
zend_argument_must_not_be_empty_error(3);
559559
RETURN_THROWS();
560560
}
561561
// TODO Check Value for permission

ext/dba/tests/value_errors_open.phpt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,9 @@ object(Dba\Connection)#%d (%d) {
121121

122122
Warning: dba_open(): Handler "bogus" is not available in %s on line %d
123123
bool(false)
124-
dba_open(): Argument #1 ($path) cannot be empty
125-
dba_open(): Argument #2 ($mode) cannot be empty
126-
dba_open(): Argument #3 ($handler) cannot be empty
124+
dba_open(): Argument #1 ($path) must not be empty
125+
dba_open(): Argument #2 ($mode) must not be empty
126+
dba_open(): Argument #3 ($handler) must not be empty
127127
dba_open(): Argument #2 ($mode) first character must be one of "r", "w", "c", or "n"
128128
dba_open(): Argument #2 ($mode) second character must be one of "d", "l", "-", or "t"
129129
dba_open(): Argument #2 ($mode) third character must be "t"
@@ -133,9 +133,9 @@ dba_open(): Argument #5 ($map_size) must be greater than or equal to 0
133133

134134
Warning: dba_popen(): Handler "bogus" is not available in %s on line %d
135135
bool(false)
136-
dba_popen(): Argument #1 ($path) cannot be empty
137-
dba_popen(): Argument #2 ($mode) cannot be empty
138-
dba_popen(): Argument #3 ($handler) cannot be empty
136+
dba_popen(): Argument #1 ($path) must not be empty
137+
dba_popen(): Argument #2 ($mode) must not be empty
138+
dba_popen(): Argument #3 ($handler) must not be empty
139139
dba_popen(): Argument #2 ($mode) first character must be one of "r", "w", "c", or "n"
140140
dba_popen(): Argument #2 ($mode) second character must be one of "d", "l", "-", or "t"
141141
dba_popen(): Argument #2 ($mode) third character must be "t"

ext/dom/document.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1525,7 +1525,7 @@ static void dom_parse_document(INTERNAL_FUNCTION_PARAMETERS, int mode)
15251525
}
15261526

15271527
if (!source_len) {
1528-
zend_argument_cannot_be_empty_error(1);
1528+
zend_argument_must_not_be_empty_error(1);
15291529
RETURN_THROWS();
15301530
}
15311531
if (ZEND_SIZE_T_INT_OVFL(source_len)) {
@@ -1579,7 +1579,7 @@ PHP_METHOD(DOMDocument, save)
15791579
}
15801580

15811581
if (file_len == 0) {
1582-
zend_argument_cannot_be_empty_error(1);
1582+
zend_argument_must_not_be_empty_error(1);
15831583
RETURN_THROWS();
15841584
}
15851585

@@ -1883,7 +1883,7 @@ static void dom_document_schema_validate(INTERNAL_FUNCTION_PARAMETERS, int type)
18831883
}
18841884

18851885
if (!source_len) {
1886-
zend_argument_cannot_be_empty_error(1);
1886+
zend_argument_must_not_be_empty_error(1);
18871887
RETURN_THROWS();
18881888
}
18891889

@@ -1992,7 +1992,7 @@ static void dom_document_relaxNG_validate(INTERNAL_FUNCTION_PARAMETERS, int type
19921992
}
19931993

19941994
if (!source_len) {
1995-
zend_argument_cannot_be_empty_error(1);
1995+
zend_argument_must_not_be_empty_error(1);
19961996
RETURN_THROWS();
19971997
}
19981998

@@ -2085,7 +2085,7 @@ static void dom_load_html(INTERNAL_FUNCTION_PARAMETERS, int mode) /* {{{ */
20852085
}
20862086

20872087
if (!source_len) {
2088-
zend_argument_cannot_be_empty_error(1);
2088+
zend_argument_must_not_be_empty_error(1);
20892089
RETURN_THROWS();
20902090
}
20912091

@@ -2162,7 +2162,7 @@ PHP_METHOD(DOMDocument, saveHTMLFile)
21622162
}
21632163

21642164
if (file_len == 0) {
2165-
zend_argument_cannot_be_empty_error(1);
2165+
zend_argument_must_not_be_empty_error(1);
21662166
RETURN_THROWS();
21672167
}
21682168

ext/dom/domimplementation.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ PHP_METHOD(DOMImplementation, createDocumentType)
6464
}
6565

6666
if (name_len == 0) {
67-
zend_argument_cannot_be_empty_error(1);
67+
zend_argument_must_not_be_empty_error(1);
6868
RETURN_THROWS();
6969
}
7070

0 commit comments

Comments
 (0)