Skip to content

Commit 224e75b

Browse files
committed
Capitalize many error messages
1 parent 9d7e03c commit 224e75b

Some content is hidden

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

83 files changed

+333
-331
lines changed

Zend/zend_exceptions.c

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 3 additions & 3 deletions
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/bz2/bz2.c

Lines changed: 5 additions & 5 deletions
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/calendar/cal_unix.c

Lines changed: 1 addition & 1 deletion
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

Lines changed: 5 additions & 5 deletions
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/com_dotnet/com_iterator.c

Lines changed: 1 addition & 1 deletion
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

Lines changed: 4 additions & 4 deletions
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/date/php_date.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4642,7 +4642,7 @@ static void php_do_date_sunrise_sunset(INTERNAL_FUNCTION_PARAMETERS, int calc_su
46424642
case 6:
46434643
break;
46444644
default:
4645-
php_error_docref(NULL, E_WARNING, "invalid format");
4645+
php_error_docref(NULL, E_WARNING, "Invalid format");
46464646
RETURN_FALSE;
46474647
break;
46484648
}

ext/ffi/ffi.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1009,7 +1009,7 @@ static zval *zend_ffi_cdata_set(zend_object *obj, zend_string *member, zval *val
10091009
#endif
10101010

10111011
if (UNEXPECTED(!zend_string_equals_literal(member, "cdata"))) {
1012-
zend_throw_error(zend_ffi_exception_ce, "only 'cdata' property may be set");
1012+
zend_throw_error(zend_ffi_exception_ce, "Only 'cdata' property may be set");
10131013
return &EG(uninitialized_zval);;
10141014
}
10151015

@@ -4003,16 +4003,16 @@ ZEND_METHOD(FFI, arrayType) /* {{{ */
40034003
type = ZEND_FFI_TYPE(ctype->type);
40044004

40054005
if (type->kind == ZEND_FFI_TYPE_FUNC) {
4006-
zend_throw_error(zend_ffi_exception_ce, "array of functions is not allowed");
4006+
zend_throw_error(zend_ffi_exception_ce, "Array of functions is not allowed");
40074007
RETURN_THROWS();
40084008
} else if (type->kind == ZEND_FFI_TYPE_ARRAY && (type->attr & ZEND_FFI_ATTR_INCOMPLETE_ARRAY)) {
4009-
zend_throw_error(zend_ffi_exception_ce, "only the leftmost array can be undimensioned");
4009+
zend_throw_error(zend_ffi_exception_ce, "Only the leftmost array can be undimensioned");
40104010
RETURN_THROWS();
40114011
} else if (type->kind == ZEND_FFI_TYPE_VOID) {
4012-
zend_throw_error(zend_ffi_exception_ce, "array of 'void' is not allowed");
4012+
zend_throw_error(zend_ffi_exception_ce, "Array of 'void' is not allowed");
40134013
RETURN_THROWS();
40144014
} else if (type->attr & ZEND_FFI_ATTR_INCOMPLETE_TAG) {
4015-
zend_throw_error(zend_ffi_exception_ce, "array of incomplete type is not allowed");
4015+
zend_throw_error(zend_ffi_exception_ce, "Array of incomplete type is not allowed");
40164016
RETURN_THROWS();
40174017
}
40184018

@@ -4189,7 +4189,7 @@ ZEND_METHOD(FFI, memcpy) /* {{{ */
41894189
} else {
41904190
ptr1 = cdata1->ptr;
41914191
if (type1->kind != ZEND_FFI_TYPE_POINTER && size > type1->size) {
4192-
zend_throw_error(zend_ffi_exception_ce, "attempt to write over data boundary");
4192+
zend_throw_error(zend_ffi_exception_ce, "Attempt to write over data boundary");
41934193
RETURN_THROWS();
41944194
}
41954195
}
@@ -4198,7 +4198,7 @@ ZEND_METHOD(FFI, memcpy) /* {{{ */
41984198
if (Z_TYPE_P(zv2) == IS_STRING) {
41994199
ptr2 = Z_STRVAL_P(zv2);
42004200
if (size > Z_STRLEN_P(zv2)) {
4201-
zend_throw_error(zend_ffi_exception_ce, "attempt to read over string boundary");
4201+
zend_throw_error(zend_ffi_exception_ce, "Attempt to read over string boundary");
42024202
RETURN_THROWS();
42034203
}
42044204
} else if (Z_TYPE_P(zv2) == IS_OBJECT && Z_OBJCE_P(zv2) == zend_ffi_cdata_ce) {
@@ -4209,7 +4209,7 @@ ZEND_METHOD(FFI, memcpy) /* {{{ */
42094209
} else {
42104210
ptr2 = cdata2->ptr;
42114211
if (type2->kind != ZEND_FFI_TYPE_POINTER && size > type2->size) {
4212-
zend_throw_error(zend_ffi_exception_ce, "attempt to read over data boundary");
4212+
zend_throw_error(zend_ffi_exception_ce, "Attempt to read over data boundary");
42134213
RETURN_THROWS();
42144214
}
42154215
}
@@ -4266,7 +4266,7 @@ ZEND_METHOD(FFI, memcmp) /* {{{ */
42664266
if (Z_TYPE_P(zv2) == IS_STRING) {
42674267
ptr2 = Z_STRVAL_P(zv2);
42684268
if (size > Z_STRLEN_P(zv2)) {
4269-
zend_throw_error(zend_ffi_exception_ce, "attempt to read over string boundary");
4269+
zend_throw_error(zend_ffi_exception_ce, "Attempt to read over string boundary");
42704270
RETURN_THROWS();
42714271
}
42724272
} else if (Z_TYPE_P(zv2) == IS_OBJECT && Z_OBJCE_P(zv2) == zend_ffi_cdata_ce) {
@@ -4277,7 +4277,7 @@ ZEND_METHOD(FFI, memcmp) /* {{{ */
42774277
} else {
42784278
ptr2 = cdata2->ptr;
42794279
if (type2->kind != ZEND_FFI_TYPE_POINTER && size > type2->size) {
4280-
zend_throw_error(zend_ffi_exception_ce, "attempt to read over data boundary");
4280+
zend_throw_error(zend_ffi_exception_ce, "Attempt to read over data boundary");
42814281
RETURN_THROWS();
42824282
}
42834283
}

ext/filter/logical_filters.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ void php_filter_float(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
360360

361361
if (decimal_set) {
362362
if (decimal_len != 1) {
363-
php_error_docref(NULL, E_WARNING, "decimal separator must be one char");
363+
php_error_docref(NULL, E_WARNING, "Decimal separator must be one char");
364364
RETURN_VALIDATION_FAILED
365365
} else {
366366
dec_sep = *decimal;
@@ -371,7 +371,7 @@ void php_filter_float(PHP_INPUT_FILTER_PARAM_DECL) /* {{{ */
371371

372372
if (thousand_set) {
373373
if (thousand_len < 1) {
374-
php_error_docref(NULL, E_WARNING, "thousand separator must be at least one char");
374+
php_error_docref(NULL, E_WARNING, "Thousand separator must be at least one char");
375375
RETURN_VALIDATION_FAILED
376376
} else {
377377
tsd_sep = thousand;

ext/ftp/ftp.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ ftp_login(ftpbuf_t *ftp, const char *user, const size_t user_len, const char *pa
272272

273273
ctx = SSL_CTX_new(SSLv23_client_method());
274274
if (ctx == NULL) {
275-
php_error_docref(NULL, E_WARNING, "failed to create the SSL context");
275+
php_error_docref(NULL, E_WARNING, "Failed to create the SSL context");
276276
return 0;
277277
}
278278

@@ -288,7 +288,7 @@ ftp_login(ftpbuf_t *ftp, const char *user, const size_t user_len, const char *pa
288288
SSL_CTX_free(ctx);
289289

290290
if (ftp->ssl_handle == NULL) {
291-
php_error_docref(NULL, E_WARNING, "failed to create the SSL handle");
291+
php_error_docref(NULL, E_WARNING, "Failed to create the SSL handle");
292292
return 0;
293293
}
294294

ext/ftp/php_ftp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -889,7 +889,7 @@ PHP_FUNCTION(ftp_nb_continue)
889889
}
890890

891891
if (!ftp->nb) {
892-
php_error_docref(NULL, E_WARNING, "no nbronous transfer to continue.");
892+
php_error_docref(NULL, E_WARNING, "No nbronous transfer to continue.");
893893
RETURN_LONG(PHP_FTP_FAILED);
894894
}
895895

ext/gd/gd_compat.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ int overflow2(int a, int b)
1111
{
1212

1313
if(a <= 0 || b <= 0) {
14-
php_error_docref(NULL, E_WARNING, "one parameter to a memory allocation multiplication is negative or zero, failing operation gracefully\n");
14+
php_error_docref(NULL, E_WARNING, "One parameter to a memory allocation multiplication is negative or zero, failing operation gracefully\n");
1515
return 1;
1616
}
1717
if(a > INT_MAX / b) {
18-
php_error_docref(NULL, E_WARNING, "product of memory allocation multiplication would exceed INT_MAX, failing operation gracefully\n");
18+
php_error_docref(NULL, E_WARNING, "Product of memory allocation multiplication would exceed INT_MAX, failing operation gracefully\n");
1919
return 1;
2020
}
2121
return 0;

ext/gettext/gettext.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ ZEND_GET_MODULE(php_gettext)
7777

7878
#define PHP_GETTEXT_DOMAIN_LENGTH_CHECK(domain_len) \
7979
if (UNEXPECTED(domain_len > PHP_GETTEXT_MAX_DOMAIN_LENGTH)) { \
80-
php_error_docref(NULL, E_WARNING, "domain passed too long"); \
80+
php_error_docref(NULL, E_WARNING, "Domain passed too long"); \
8181
RETURN_FALSE; \
8282
}
8383

ext/hash/hash.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1065,7 +1065,7 @@ PHP_FUNCTION(mhash_keygen_s2k)
10651065

10661066
bytes = (int)l_bytes;
10671067
if (bytes <= 0){
1068-
php_error_docref(NULL, E_WARNING, "the byte parameter must be greater than 0");
1068+
php_error_docref(NULL, E_WARNING, "The byte parameter must be greater than 0");
10691069
RETURN_FALSE;
10701070
}
10711071

0 commit comments

Comments
 (0)