Skip to content

Commit 74caba9

Browse files
committed
ext/dom: Use standard wording for ValueError
1 parent b34ccc3 commit 74caba9

10 files changed

+15
-15
lines changed

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_value_error(1, "must not be empty");
1528+
zend_argument_cannot_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_value_error(1, "must not be empty");
1582+
zend_argument_cannot_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_value_error(1, "must not be empty");
1886+
zend_argument_cannot_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_value_error(1, "must not be empty");
1995+
zend_argument_cannot_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_value_error(1, "must not be empty");
2088+
zend_argument_cannot_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_value_error(1, "must not be empty");
2165+
zend_argument_cannot_be_empty_error(1);
21662166
RETURN_THROWS();
21672167
}
21682168

ext/dom/html_document.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1283,7 +1283,7 @@ PHP_METHOD(Dom_HTMLDocument, saveHtmlFile)
12831283
}
12841284

12851285
if (file_len == 0) {
1286-
zend_argument_value_error(1, "must not be empty");
1286+
zend_argument_cannot_be_empty_error(1);
12871287
RETURN_THROWS();
12881288
}
12891289

ext/dom/tests/DOMDocument_loadHTML_error2.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-
DOMDocument::loadHTML(): Argument #1 ($source) must not be empty
17+
DOMDocument::loadHTML(): Argument #1 ($source) cannot be empty

ext/dom/tests/DOMDocument_loadHTMLfile_error2.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@ try {
2323
}
2424
?>
2525
--EXPECT--
26-
DOMDocument::loadHTMLFile(): Argument #1 ($filename) must not be empty
26+
DOMDocument::loadHTMLFile(): Argument #1 ($filename) cannot be empty
2727
DOMDocument::loadHTMLFile(): Argument #1 ($filename) must not contain any null bytes

ext/dom/tests/DOMDocument_loadXML_error6.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ try {
1313
}
1414
?>
1515
--EXPECT--
16-
DOMDocument::loadXML(): Argument #1 ($source) must not be empty
16+
DOMDocument::loadXML(): Argument #1 ($source) cannot be empty

ext/dom/tests/DOMDocument_load_error6.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ try {
2222
var_dump($dom->load(str_repeat(" ", PHP_MAXPATHLEN + 1)));
2323
?>
2424
--EXPECT--
25-
DOMDocument::load(): Argument #1 ($filename) must not be empty
25+
DOMDocument::load(): Argument #1 ($filename) cannot be empty
2626
DOMDocument::load(): Argument #1 ($filename) must not contain any null bytes
2727
bool(false)

ext/dom/tests/DOMDocument_saveHTMLFile_invalid_filename.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ try {
2424
}
2525
?>
2626
--EXPECT--
27-
DOMDocument::saveHTMLFile(): Argument #1 ($filename) must not be empty
27+
DOMDocument::saveHTMLFile(): Argument #1 ($filename) cannot be empty

ext/dom/tests/DOMDocument_schemaValidateSource_error3.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ try {
2020

2121
?>
2222
--EXPECT--
23-
DOMDocument::schemaValidateSource(): Argument #1 ($source) must not be empty
23+
DOMDocument::schemaValidateSource(): Argument #1 ($source) cannot be empty

ext/dom/tests/DOMDocument_schemaValidate_error3.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ try {
2020

2121
?>
2222
--EXPECT--
23-
DOMDocument::schemaValidate(): Argument #1 ($filename) must not be empty
23+
DOMDocument::schemaValidate(): Argument #1 ($filename) cannot be empty

ext/dom/tests/modern/html/interactions/HTMLDocument_saveHTMLFile_empty_path.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ $dom->saveHtmlFile("");
1111

1212
?>
1313
--EXPECTF--
14-
Fatal error: Uncaught ValueError: Dom\HTMLDocument::saveHtmlFile(): Argument #1 ($filename) must not be empty in %s:%d
14+
Fatal error: Uncaught ValueError: Dom\HTMLDocument::saveHtmlFile(): Argument #1 ($filename) cannot be empty in %s:%d
1515
Stack trace:
1616
#0 %s(%d): Dom\HTMLDocument->saveHtmlFile('')
1717
#1 {main}

0 commit comments

Comments
 (0)