Skip to content

Commit d1764ca

Browse files
committed
Make error messages more consistent by fixing capitalization
Closes GH-5066 As a first step, let's capitalize their initial letter when it is applicable.
1 parent 117b18d commit d1764ca

File tree

432 files changed

+1525
-1525
lines changed

Some content is hidden

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

432 files changed

+1525
-1525
lines changed

Zend/tests/bug30998.phpt

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ set_error_handler('my_error');
1414
$f = fopen("/tmp/blah", "r");
1515
?>
1616
--EXPECTF--
17-
fopen(/tmp/blah): failed to open stream: %s (2) in %s:%d
17+
fopen(/tmp/blah): Failed to open stream: %s (2) in %s:%d
1818

19-
Warning: fopen(/tmp/blah): failed to open stream: %s in %s on line %d
19+
Warning: fopen(/tmp/blah): Failed to open stream: %s in %s on line %d

Zend/tests/bug60909_1.phpt

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ set_error_handler(function($errno, $errstr, $errfile, $errline){
1010

1111
require 'notfound.php';
1212
--EXPECTF--
13-
error(require(notfound.php): failed to open stream: %s)
13+
error(require(notfound.php): Failed to open stream: %s)
1414
Fatal error: Uncaught Exception: Foo in %sbug60909_1.php:5
1515
Stack trace:
1616
#0 %sbug60909_1.php(8): {closure}(2, 'require(notfoun...', '%s', 8)

Zend/tests/bug64960.phpt

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ set_error_handler(function()
2929
$a['waa'];
3030
?>
3131
--EXPECTF--
32-
Notice: ob_end_flush(): failed to delete and flush buffer. No buffer to delete or flush in %sbug64960.php on line 3
32+
Notice: ob_end_flush(): Failed to delete and flush buffer. No buffer to delete or flush in %sbug64960.php on line 3
3333

3434
Fatal error: Uncaught Exception in %sbug64960.php:19
3535
Stack trace:

Zend/tests/debug_backtrace_with_include_and_this.phpt

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ try {
2828
echo $e."\n";
2929
}
3030
--EXPECTF--
31-
ERR#2: include(class://non.existent.Class): failed to open stream: "CLWrapper::stream_open" call failed @ include
31+
ERR#2: include(class://non.existent.Class): Failed to open stream: "CLWrapper::stream_open" call failed @ include
3232
ERR#2: include(): Failed opening 'class://non.existent.Class' for inclusion (include_path='%s') @ include
3333

3434
Fatal error: Uncaught Exception: Failed loading class://non.existent.Class in %s

Zend/tests/include_stat_is_quiet.phpt

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@ try {
2525

2626
?>
2727
--EXPECTF--
28-
Warning: require_once(doesnt_exist.php): failed to open stream: No such file or directory in %s on line %d
28+
Warning: require_once(doesnt_exist.php): Failed to open stream: No such file or directory in %s on line %d
2929

3030
Fatal error: require_once(): Failed opening required 'doesnt_exist.php' (include_path='test://foo:test://bar') in %s on line %d

Zend/zend_exceptions.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,7 @@ ZEND_METHOD(exception, getTraceAsString)
627627

628628
trace = zend_read_property_ex(base_ce, object, ZSTR_KNOWN(ZEND_STR_TRACE), 1, &rv);
629629
if (Z_TYPE_P(trace) != IS_ARRAY) {
630-
zend_type_error("trace is not an array");
630+
zend_type_error("Trace is not an array");
631631
return;
632632
}
633633
ZEND_HASH_FOREACH_NUM_KEY_VAL(Z_ARRVAL_P(trace), index, frame) {

ext/bcmath/libbcmath/src/raise.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ bc_raise (bc_num num1, bc_num num2, bc_num *result, int scale)
5454

5555
/* Check the exponent for scale digits and convert to a long. */
5656
if (num2->n_scale != 0)
57-
php_error_docref (NULL, E_WARNING, "non-zero scale in exponent");
57+
php_error_docref (NULL, E_WARNING, "Non-zero scale in exponent");
5858
exponent = bc_num2long (num2);
5959
if (exponent == 0 && (num2->n_len > 1 || num2->n_value[0] != 0))
60-
php_error_docref (NULL, E_WARNING, "exponent too large");
60+
php_error_docref (NULL, E_WARNING, "Exponent too large");
6161

6262
/* Special case if exponent is a zero. */
6363
if (exponent == 0)

ext/bcmath/libbcmath/src/raisemod.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -79,21 +79,21 @@ bc_raisemod (bc_num base, bc_num expo, bc_num mod, bc_num *result, int scale)
7979
/* Check the base for scale digits. */
8080
if (power->n_scale != 0)
8181
{
82-
php_error_docref (NULL, E_WARNING, "non-zero scale in base");
82+
php_error_docref (NULL, E_WARNING, "Non-zero scale in base");
8383
_bc_truncate (&power);
8484
}
8585

8686
/* Check the exponent for scale digits. */
8787
if (exponent->n_scale != 0)
8888
{
89-
php_error_docref (NULL, E_WARNING, "non-zero scale in exponent");
89+
php_error_docref (NULL, E_WARNING, "Non-zero scale in exponent");
9090
_bc_truncate (&exponent);
9191
}
9292

9393
/* Check the modulus for scale digits. */
9494
if (modulus->n_scale != 0)
9595
{
96-
php_error_docref (NULL, E_WARNING, "non-zero scale in modulus");
96+
php_error_docref (NULL, E_WARNING, "Non-zero scale in modulus");
9797
_bc_truncate (&modulus);
9898
}
9999

ext/bcmath/tests/bcpow_error1.phpt

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ if (!extension_loaded('bcmath')) die('skip bcmath extension is not available');
99
var_dump(bcpow('1', '1.1', 2));
1010
?>
1111
--EXPECTF--
12-
Warning: bcpow(): non-zero scale in exponent in %s on line %d
12+
Warning: bcpow(): Non-zero scale in exponent in %s on line %d
1313
string(4) "1.00"

ext/bcmath/tests/bcpow_error2.phpt

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ if (!extension_loaded('bcmath')) die('skip bcmath extension is not available');
99
var_dump(bcpow('0', '9223372036854775808', 2));
1010
?>
1111
--EXPECTF--
12-
Warning: bcpow(): exponent too large in %s on line %d
12+
Warning: bcpow(): Exponent too large in %s on line %d
1313
string(4) "1.00"

ext/bcmath/tests/bug72093.phpt

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ var_dump(bcpowmod(1, 1.2, 1, 1));
1212
--EXPECTF--
1313
string(1) "1"
1414

15-
Warning: bcpowmod(): non-zero scale in exponent in %s on line %d
15+
Warning: bcpowmod(): Non-zero scale in exponent in %s on line %d
1616
string(3) "0.0"

ext/bcmath/tests/bug75178.phpt

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ var_dump(bcpowmod('4.1', '4', '3', 3));
1010
var_dump(bcpowmod('4', '4', '3.1', 3));
1111
?>
1212
--EXPECTF--
13-
Warning: bcpowmod(): non-zero scale in base in %s on line %d
13+
Warning: bcpowmod(): Non-zero scale in base in %s on line %d
1414
string(5) "1.000"
1515

16-
Warning: bcpowmod(): non-zero scale in modulus in %s on line %d
16+
Warning: bcpowmod(): Non-zero scale in modulus in %s on line %d
1717
string(5) "1.000"

ext/bz2/bz2.c

+5-5
Original file line numberDiff line numberDiff line change
@@ -374,12 +374,12 @@ static PHP_FUNCTION(bzopen)
374374
/* If it's not a resource its a string containing the filename to open */
375375
if (Z_TYPE_P(file) == IS_STRING) {
376376
if (Z_STRLEN_P(file) == 0) {
377-
php_error_docref(NULL, E_WARNING, "filename cannot be empty");
377+
php_error_docref(NULL, E_WARNING, "Filename cannot be empty");
378378
RETURN_FALSE;
379379
}
380380

381381
if (CHECK_ZVAL_NULL_PATH(file)) {
382-
zend_type_error("filename must not contain null bytes");
382+
zend_type_error("Filename must not contain null bytes");
383383
RETURN_THROWS();
384384
}
385385

@@ -393,18 +393,18 @@ static PHP_FUNCTION(bzopen)
393393
stream_mode_len = strlen(stream->mode);
394394

395395
if (stream_mode_len != 1 && !(stream_mode_len == 2 && memchr(stream->mode, 'b', 2))) {
396-
php_error_docref(NULL, E_WARNING, "cannot use stream opened in mode '%s'", stream->mode);
396+
php_error_docref(NULL, E_WARNING, "Cannot use stream opened in mode '%s'", stream->mode);
397397
RETURN_FALSE;
398398
} else if (stream_mode_len == 1 && stream->mode[0] != 'r' && stream->mode[0] != 'w' && stream->mode[0] != 'a' && stream->mode[0] != 'x') {
399-
php_error_docref(NULL, E_WARNING, "cannot use stream opened in mode '%s'", stream->mode);
399+
php_error_docref(NULL, E_WARNING, "Cannot use stream opened in mode '%s'", stream->mode);
400400
RETURN_FALSE;
401401
}
402402

403403
switch(mode[0]) {
404404
case 'r':
405405
/* only "r" and "rb" are supported */
406406
if (stream->mode[0] != mode[0] && !(stream_mode_len == 2 && stream->mode[1] != mode[0])) {
407-
php_error_docref(NULL, E_WARNING, "cannot read from a stream opened in write only mode");
407+
php_error_docref(NULL, E_WARNING, "Cannot read from a stream opened in write only mode");
408408
RETURN_FALSE;
409409
}
410410
break;

ext/bz2/tests/001.phpt

+3-3
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@ var_dump(bzopen($fp, "r"));
3939
--EXPECTF--
4040
'' is not a valid mode for bzopen(). Only 'w' and 'r' are supported.
4141

42-
Warning: bzopen(): filename cannot be empty in %s on line %d
42+
Warning: bzopen(): Filename cannot be empty in %s on line %d
4343
bool(false)
4444

45-
Warning: bzopen(): filename cannot be empty in %s on line %d
45+
Warning: bzopen(): Filename cannot be empty in %s on line %d
4646
bool(false)
4747
'x' is not a valid mode for bzopen(). Only 'w' and 'r' are supported.
4848
'rw' is not a valid mode for bzopen(). Only 'w' and 'r' are supported.
4949

50-
Warning: bzopen(no_such_file): failed to open stream: No such file or directory in %s on line %d
50+
Warning: bzopen(no_such_file): Failed to open stream: No such file or directory in %s on line %d
5151
bool(false)
5252
resource(%d) of type (stream)

ext/bz2/tests/002.phpt

+13-13
Original file line numberDiff line numberDiff line change
@@ -85,47 +85,47 @@ resource(%d) of type (stream)
8585
resource(%d) of type (stream)
8686
resource(%d) of type (stream)
8787

88-
Warning: bzopen(): cannot read from a stream opened in write only mode in %s on line %d
88+
Warning: bzopen(): Cannot read from a stream opened in write only mode in %s on line %d
8989
bool(false)
9090
resource(%d) of type (stream)
9191
resource(%d) of type (stream)
9292

93-
Warning: fopen(bz_open_002.txt): failed to open stream: Bad file %s in %s on line %d
93+
Warning: fopen(bz_open_002.txt): Failed to open stream: Bad file %s in %s on line %d
9494
First parameter has to be string or file-resource
9595

96-
Warning: fopen(bz_open_002.txt): failed to open stream: Bad file %s in %s on line %d
96+
Warning: fopen(bz_open_002.txt): Failed to open stream: Bad file %s in %s on line %d
9797
First parameter has to be string or file-resource
9898

9999
Warning: bzopen(): cannot write to a stream opened in read only mode in %s on line %d
100100
bool(false)
101101

102-
Warning: bzopen(): cannot read from a stream opened in write only mode in %s on line %d
102+
Warning: bzopen(): Cannot read from a stream opened in write only mode in %s on line %d
103103
bool(false)
104104

105-
Warning: bzopen(): cannot use stream opened in mode 'rw' in %s on line %d
105+
Warning: bzopen(): Cannot use stream opened in mode 'rw' in %s on line %d
106106
bool(false)
107107

108-
Warning: bzopen(): cannot use stream opened in mode 'rw' in %s on line %d
108+
Warning: bzopen(): Cannot use stream opened in mode 'rw' in %s on line %d
109109
bool(false)
110110

111-
Warning: bzopen(): cannot use stream opened in mode 'wr' in %s on line %d
111+
Warning: bzopen(): Cannot use stream opened in mode 'wr' in %s on line %d
112112
bool(false)
113113

114-
Warning: bzopen(): cannot use stream opened in mode 'wr' in %s on line %d
114+
Warning: bzopen(): Cannot use stream opened in mode 'wr' in %s on line %d
115115
bool(false)
116116

117-
Warning: bzopen(): cannot use stream opened in mode 'r+' in %s on line %d
117+
Warning: bzopen(): Cannot use stream opened in mode 'r+' in %s on line %d
118118
bool(false)
119119

120-
Warning: bzopen(): cannot use stream opened in mode 'r+' in %s on line %d
120+
Warning: bzopen(): Cannot use stream opened in mode 'r+' in %s on line %d
121121
bool(false)
122122

123-
Warning: bzopen(): cannot use stream opened in mode 'w+' in %s on line %d
123+
Warning: bzopen(): Cannot use stream opened in mode 'w+' in %s on line %d
124124
bool(false)
125125

126-
Warning: bzopen(): cannot use stream opened in mode 'w+' in %s on line %d
126+
Warning: bzopen(): Cannot use stream opened in mode 'w+' in %s on line %d
127127
bool(false)
128128

129-
Warning: bzopen(): cannot read from a stream opened in write only mode in %s on line %d
129+
Warning: bzopen(): Cannot read from a stream opened in write only mode in %s on line %d
130130
bool(false)
131131
resource(%d) of type (stream)

ext/bz2/tests/bzopen_string_filename_with_null_bytes.phpt

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@ try {
1919

2020
?>
2121
--EXPECT--
22-
filename must not contain null bytes
23-
filename must not contain null bytes
22+
Filename must not contain null bytes
23+
Filename must not contain null bytes

ext/calendar/cal_unix.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ PHP_FUNCTION(unixtojd)
3535
if (!ts) {
3636
ts = time(NULL);
3737
} else if (ts < 0) {
38-
zend_value_error("timestamp must not be negative");
38+
zend_value_error("Timestamp must not be negative");
3939
RETURN_THROWS();
4040
}
4141

ext/calendar/calendar.c

+5-5
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ PHP_FUNCTION(cal_info)
217217

218218

219219
if (cal != -1 && (cal < 0 || cal >= CAL_NUM_CALS)) {
220-
zend_value_error("invalid calendar ID " ZEND_LONG_FMT, cal);
220+
zend_value_error("Invalid calendar ID: " ZEND_LONG_FMT, cal);
221221
RETURN_THROWS();
222222
}
223223

@@ -239,7 +239,7 @@ PHP_FUNCTION(cal_days_in_month)
239239
}
240240

241241
if (cal < 0 || cal >= CAL_NUM_CALS) {
242-
zend_value_error("invalid calendar ID " ZEND_LONG_FMT, cal);
242+
zend_value_error("Invalid calendar ID: " ZEND_LONG_FMT, cal);
243243
RETURN_THROWS();
244244
}
245245

@@ -248,7 +248,7 @@ PHP_FUNCTION(cal_days_in_month)
248248
sdn_start = calendar->to_jd(year, month, 1);
249249

250250
if (sdn_start == 0) {
251-
zend_value_error("invalid date");
251+
zend_value_error("Invalid date");
252252
RETURN_THROWS();
253253
}
254254

@@ -285,7 +285,7 @@ PHP_FUNCTION(cal_to_jd)
285285
}
286286

287287
if (cal < 0 || cal >= CAL_NUM_CALS) {
288-
zend_value_error("invalid calendar ID " ZEND_LONG_FMT, cal);
288+
zend_value_error("Invalid calendar ID: " ZEND_LONG_FMT, cal);
289289
RETURN_THROWS();
290290
}
291291

@@ -306,7 +306,7 @@ PHP_FUNCTION(cal_from_jd)
306306
}
307307

308308
if (cal < 0 || cal >= CAL_NUM_CALS) {
309-
zend_value_error("invalid calendar ID " ZEND_LONG_FMT, cal);
309+
zend_value_error("Invalid calendar ID: " ZEND_LONG_FMT, cal);
310310
RETURN_THROWS();
311311
}
312312
calendar = &cal_conversion_table[cal];

ext/calendar/tests/cal_days_in_month_error1.phpt

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ try{
1818
}
1919
?>
2020
--EXPECT--
21-
invalid calendar ID -1
22-
invalid date
21+
Invalid calendar ID: -1
22+
Invalid date

ext/calendar/tests/cal_from_jd_error1.phpt

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ try {
1313
}
1414
?>
1515
--EXPECT--
16-
invalid calendar ID -1
16+
Invalid calendar ID: -1

ext/calendar/tests/cal_info.phpt

+1-1
Original file line numberDiff line numberDiff line change
@@ -216,4 +216,4 @@ Array
216216
[calname] => Julian
217217
[calsymbol] => CAL_JULIAN
218218
)
219-
invalid calendar ID 99999
219+
Invalid calendar ID: 99999

ext/calendar/tests/cal_to_jd_error1.phpt

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ try {
1313
}
1414
?>
1515
--EXPECT--
16-
invalid calendar ID -1
16+
Invalid calendar ID: -1

ext/calendar/tests/unixtojd_error1.phpt

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ var_dump(unixtojd(null)) . PHP_EOL;
2020
var_dump(unixtojd(time())) . PHP_EOL;
2121
?>
2222
--EXPECTF--
23-
timestamp must not be negative
23+
Timestamp must not be negative
2424
int(%d)
2525
int(%d)
2626
int(%d)

ext/com_dotnet/com_iterator.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ zend_object_iterator *php_com_iter_get(zend_class_entry *ce, zval *object, int b
148148
obj = CDNO_FETCH(object);
149149

150150
if (V_VT(&obj->v) != VT_DISPATCH && !V_ISARRAY(&obj->v)) {
151-
php_error_docref(NULL, E_WARNING, "variant is not an object or array VT=%d", V_VT(&obj->v));
151+
php_error_docref(NULL, E_WARNING, "Variant is not an object or array VT=%d", V_VT(&obj->v));
152152
return NULL;
153153
}
154154

ext/curl/interface.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -1671,7 +1671,7 @@ PHP_FUNCTION(curl_version)
16711671
ZEND_PARSE_PARAMETERS_END();
16721672

16731673
if (uversion == CURLVERSION_NOW) {
1674-
php_error_docref(NULL, E_DEPRECATED, "the $version parameter is deprecated");
1674+
php_error_docref(NULL, E_DEPRECATED, "The $version parameter is deprecated");
16751675
} else if (ZEND_NUM_ARGS() > 0) {
16761676
php_error_docref(NULL, E_WARNING, "$version argument ignored");
16771677
}
@@ -2576,7 +2576,7 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue) /* {{{
25762576
ch->handlers->write->method = PHP_CURL_FILE;
25772577
ZVAL_COPY(&ch->handlers->write->stream, zvalue);
25782578
} else {
2579-
php_error_docref(NULL, E_WARNING, "the provided file handle is not writable");
2579+
php_error_docref(NULL, E_WARNING, "The provided file handle is not writable");
25802580
return FAILURE;
25812581
}
25822582
break;
@@ -2594,7 +2594,7 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue) /* {{{
25942594
ch->handlers->write_header->method = PHP_CURL_FILE;
25952595
ZVAL_COPY(&ch->handlers->write_header->stream, zvalue);
25962596
} else {
2597-
php_error_docref(NULL, E_WARNING, "the provided file handle is not writable");
2597+
php_error_docref(NULL, E_WARNING, "The provided file handle is not writable");
25982598
return FAILURE;
25992599
}
26002600
break;
@@ -2623,7 +2623,7 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue) /* {{{
26232623
zval_ptr_dtor(&ch->handlers->std_err);
26242624
ZVAL_COPY(&ch->handlers->std_err, zvalue);
26252625
} else {
2626-
php_error_docref(NULL, E_WARNING, "the provided file handle is not writable");
2626+
php_error_docref(NULL, E_WARNING, "The provided file handle is not writable");
26272627
return FAILURE;
26282628
}
26292629
/* break omitted intentionally */

ext/curl/tests/bug48207.phpt

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,6 @@ is_file($tempfile) and @unlink($tempfile);
4343
isset($tempname) and is_file($tempname) and @unlink($tempname);
4444
?>
4545
--EXPECTF--
46-
Warning: curl_setopt(): the provided file handle is not writable in %s on line %d
46+
Warning: curl_setopt(): The provided file handle is not writable in %s on line %d
4747
Hello World!
4848
Hello World!

ext/curl/tests/curl_version_error_001.phpt

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ curl_version(CURLVERSION_NOW);
1010
curl_version(0);
1111
?>
1212
--EXPECTF--
13-
Deprecated: curl_version(): the $version parameter is deprecated in %s on line %d
13+
Deprecated: curl_version(): The $version parameter is deprecated in %s on line %d
1414

1515
Warning: curl_version(): $version argument ignored in %s on line %d

0 commit comments

Comments
 (0)