summaryrefslogtreecommitdiff
path: root/Zend/zend_exceptions.c
diff options
context:
space:
mode:
Diffstat (limited to 'Zend/zend_exceptions.c')
-rw-r--r--Zend/zend_exceptions.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/Zend/zend_exceptions.c b/Zend/zend_exceptions.c
index 6945af9fe8..59cad0b0f7 100644
--- a/Zend/zend_exceptions.c
+++ b/Zend/zend_exceptions.c
@@ -144,7 +144,7 @@ ZEND_METHOD(exception, __construct)
UErrorCode status = U_ZERO_ERROR;
UChar *u_str;
int32_t u_len;
-
+
zend_convert_to_unicode(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &u_str, &u_len, message, message_len, &status);
zend_update_property_unicodel(default_exception_ce, object, "message", sizeof("message")-1, u_str, u_len TSRMLS_CC);
efree(u_str);
@@ -183,7 +183,7 @@ ZEND_METHOD(error_exception, __construct)
UErrorCode status = U_ZERO_ERROR;
UChar *u_str;
int32_t u_len;
-
+
zend_convert_to_unicode(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &u_str, &u_len, message, message_len, &status);
zend_update_property_unicodel(default_exception_ce, object, "message", sizeof("message")-1, u_str, u_len TSRMLS_CC);
efree(u_str);
@@ -197,11 +197,11 @@ ZEND_METHOD(error_exception, __construct)
}
zend_update_property_long(default_exception_ce, object, "severity", sizeof("severity")-1, severity TSRMLS_CC);
-
+
if (argc >= 4) {
if (file_type == IS_UNICODE) {
zend_update_property_unicodel(default_exception_ce, object, "file", sizeof("file")-1, filename, filename_len TSRMLS_CC);
- } else {
+ } else {
zend_update_property_stringl(default_exception_ce, object, "file", sizeof("file")-1, filename, filename_len TSRMLS_CC);
}
if (argc < 5) {
@@ -460,7 +460,7 @@ static int _build_trace_args(zval **arg, int num_args, va_list args, zend_hash_k
if(!dup) {
efree(class_name);
}
-
+
TRACE_APPEND_STR("), ");
break;
}
@@ -523,7 +523,7 @@ ZEND_METHOD(exception, getTraceAsString)
zval *trace;
char *res = estrdup(""), **str = &res, *s_tmp;
int res_len = 0, *len = &res_len, num = 0;
-
+
trace = zend_read_property(default_exception_ce, getThis(), "trace", sizeof("trace")-1, 1 TSRMLS_CC);
zend_hash_apply_with_arguments(Z_ARRVAL_P(trace), (apply_func_args_t)_build_trace_string, 3, str, len, &num);
@@ -532,8 +532,8 @@ ZEND_METHOD(exception, getTraceAsString)
TRACE_APPEND_STRL(s_tmp, strlen(s_tmp));
efree(s_tmp);
- res[res_len] = '\0';
- RETURN_STRINGL(res, res_len, 0);
+ res[res_len] = '\0';
+ RETURN_STRINGL(res, res_len, 0);
}
/* }}} */
@@ -542,7 +542,7 @@ int zend_spprintf(char **message, int max_len, char *format, ...)
va_list arg;
int len;
- va_start(arg, format);
+ va_start(arg, format);
len = zend_vspprintf(message, max_len, format, arg);
va_end(arg);
return len;
@@ -585,12 +585,12 @@ ZEND_METHOD(exception, __toString)
}
if (Z_UNILEN(message) > 0) {
- len = zend_spprintf(&str, 0, "exception '%v' with message '%R' in %R:%ld\nStack trace:\n%s",
- Z_OBJCE_P(getThis())->name, Z_TYPE(message), Z_UNIVAL(message), Z_TYPE(file), Z_UNIVAL(file), Z_LVAL(line),
+ len = zend_spprintf(&str, 0, "exception '%v' with message '%R' in %R:%ld\nStack trace:\n%s",
+ Z_OBJCE_P(getThis())->name, Z_TYPE(message), Z_UNIVAL(message), Z_TYPE(file), Z_UNIVAL(file), Z_LVAL(line),
(trace && Z_STRLEN_P(trace)) ? Z_STRVAL_P(trace) : "#0 {main}\n");
} else {
- len = zend_spprintf(&str, 0, "exception '%v' in %R:%ld\nStack trace:\n%s",
- Z_OBJCE_P(getThis())->name, Z_TYPE(file), Z_UNIVAL(file), Z_LVAL(line),
+ len = zend_spprintf(&str, 0, "exception '%v' in %R:%ld\nStack trace:\n%s",
+ Z_OBJCE_P(getThis())->name, Z_TYPE(file), Z_UNIVAL(file), Z_LVAL(line),
(trace && Z_STRLEN_P(trace)) ? Z_STRVAL_P(trace) : "#0 {main}\n");
}
@@ -612,9 +612,9 @@ ZEND_METHOD(exception, __toString)
/* All functions that may be used in uncaught exception handlers must be final
* and must not throw exceptions. Otherwise we would need a facility to handle
- * such exceptions in that handler.
+ * such exceptions in that handler.
* Also all getXY() methods are final because thy serve as read only access to
- * their corresponding properties, no more, no less. If after all you need to
+ * their corresponding properties, no more, no less. If after all you need to
* override somthing then it is method __toString().
* And never try to change the state of exceptions and never implement anything
* that gives the user anything to accomplish this.
@@ -659,7 +659,7 @@ void zend_register_default_exception(TSRMLS_D)
INIT_CLASS_ENTRY(ce, "Exception", default_exception_functions);
default_exception_ce = zend_register_internal_class(&ce TSRMLS_CC);
- default_exception_ce->create_object = zend_default_exception_new;
+ default_exception_ce->create_object = zend_default_exception_new;
memcpy(&default_exception_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
default_exception_handlers.clone_obj = NULL;
@@ -672,7 +672,7 @@ void zend_register_default_exception(TSRMLS_D)
INIT_CLASS_ENTRY(ce, "ErrorException", error_exception_functions);
error_exception_ce = zend_register_internal_class_ex(&ce, default_exception_ce, NULL TSRMLS_CC);
- error_exception_ce->create_object = zend_error_exception_new;
+ error_exception_ce->create_object = zend_error_exception_new;
zend_declare_property_long(error_exception_ce, "severity", sizeof("severity")-1, E_ERROR, ZEND_ACC_PROTECTED TSRMLS_CC);
}
@@ -701,7 +701,7 @@ ZEND_API zval * zend_throw_exception(zend_class_entry *exception_ce, char *messa
exception_ce = default_exception_ce;
}
object_init_ex(ex, exception_ce);
-
+
if (message) {
zend_update_property_rt_string(default_exception_ce, ex, "message", sizeof("message")-1, message TSRMLS_CC);
@@ -721,7 +721,7 @@ ZEND_API zval * zend_throw_exception_ex(zend_class_entry *exception_ce, long cod
char *message;
zval *zexception;
- va_start(arg, format);
+ va_start(arg, format);
zend_vspprintf(&message, 0, format, arg);
va_end(arg);
zexception = zend_throw_exception(exception_ce, message, code TSRMLS_CC);
@@ -740,7 +740,7 @@ ZEND_API zval * zend_throw_error_exception(zend_class_entry *exception_ce, char
static void zend_error_va(int type, const char *file, uint lineno, const char *format, ...)
{
va_list args;
-
+
va_start(args, format);
zend_error_cb(type, file, lineno, format, args);
va_end(args);
@@ -754,7 +754,7 @@ ZEND_API void zend_exception_error(zval *exception TSRMLS_DC)
zval *str, *file, *line;
EG(exception) = NULL;
-
+
zend_call_method_with_0_params(&exception, ce_exception, NULL, "__tostring", &str);
if (!EG(exception)) {
if (Z_TYPE_P(str) != IS_STRING) {
@@ -764,7 +764,7 @@ ZEND_API void zend_exception_error(zval *exception TSRMLS_DC)
}
}
zval_ptr_dtor(&str);
-
+
if (EG(exception)) {
/* do the best we can to inform about the inner exception */
if (instanceof_function(ce_exception, default_exception_ce TSRMLS_CC)) {