summaryrefslogtreecommitdiff
path: root/ext/reflection/php_reflection.c
diff options
context:
space:
mode:
authorAaron Piotrowski <aaron@trowski.com>2015-07-05 02:37:49 -0500
committerAaron Piotrowski <aaron@trowski.com>2015-07-05 12:16:57 -0500
commit907476f34c0dbe34e311c4a99cc07eb40fd2954b (patch)
tree58c26abe27284c5c221182161cb89fdc90cadc1e /ext/reflection/php_reflection.c
parent550bbf8f4614a5c868010195f562be3e9ee6bb00 (diff)
downloadphp-git-907476f34c0dbe34e311c4a99cc07eb40fd2954b.tar.gz
Convert E_ERROR to thrown Error in extensions
Diffstat (limited to 'ext/reflection/php_reflection.c')
-rw-r--r--ext/reflection/php_reflection.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c
index 463cbd6a3a..4684954567 100644
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@ -88,7 +88,7 @@ ZEND_DECLARE_MODULE_GLOBALS(reflection)
#define METHOD_NOTSTATIC(ce) \
if (!Z_OBJ(EX(This)) || !instanceof_function(Z_OBJCE(EX(This)), ce)) { \
- php_error_docref(NULL, E_ERROR, "%s() cannot be called statically", get_active_function_name()); \
+ zend_throw_error(zend_ce_error, "%s() cannot be called statically", get_active_function_name()); \
return; \
} \
@@ -106,7 +106,8 @@ ZEND_DECLARE_MODULE_GLOBALS(reflection)
intern = Z_REFLECTION_P(getThis()); \
if (intern == NULL || intern->ptr == NULL) { \
RETURN_ON_EXCEPTION \
- php_error_docref(NULL, E_ERROR, "Internal error: Failed to retrieve the reflection object"); \
+ zend_throw_error(zend_ce_error, "Internal error: Failed to retrieve the reflection object"); \
+ return; \
} \
#define GET_REFLECTION_OBJECT_PTR(target) \
@@ -1473,7 +1474,8 @@ static parameter_reference *_reflection_param_get_default_param(INTERNAL_FUNCTIO
if (EG(exception) && EG(exception)->ce == reflection_exception_ptr) {
return NULL;
}
- php_error_docref(NULL, E_ERROR, "Internal error: Failed to retrieve the reflection object");
+ zend_throw_error(zend_ce_error, "Internal error: Failed to retrieve the reflection object");
+ return NULL;
}
param = intern->ptr;
@@ -4955,8 +4957,8 @@ ZEND_METHOD(reflection_class, isSubclassOf)
if (instanceof_function(Z_OBJCE_P(class_name), reflection_class_ptr)) {
argument = Z_REFLECTION_P(class_name);
if (argument == NULL || argument->ptr == NULL) {
- php_error_docref(NULL, E_ERROR, "Internal error: Failed to retrieve the argument's reflection object");
- /* Bails out */
+ zend_throw_error(zend_ce_error, "Internal error: Failed to retrieve the argument's reflection object");
+ return;
}
class_ce = argument->ptr;
break;
@@ -4999,8 +5001,8 @@ ZEND_METHOD(reflection_class, implementsInterface)
if (instanceof_function(Z_OBJCE_P(interface), reflection_class_ptr)) {
argument = Z_REFLECTION_P(interface);
if (argument == NULL || argument->ptr == NULL) {
- php_error_docref(NULL, E_ERROR, "Internal error: Failed to retrieve the argument's reflection object");
- /* Bails out */
+ zend_throw_error(zend_ce_error, "Internal error: Failed to retrieve the argument's reflection object");
+ return;
}
interface_ce = argument->ptr;
break;
@@ -5395,7 +5397,7 @@ ZEND_METHOD(reflection_property, getValue)
return;
}
if (Z_TYPE(CE_STATIC_MEMBERS(intern->ce)[ref->prop.offset]) == IS_UNDEF) {
- php_error_docref(NULL, E_ERROR, "Internal error: Could not find the property %s::%s", ZSTR_VAL(intern->ce->name), ZSTR_VAL(ref->prop.name));
+ zend_throw_error(zend_ce_error, "Internal error: Could not find the property %s::%s", ZSTR_VAL(intern->ce->name), ZSTR_VAL(ref->prop.name));
/* Bails out */
}
ZVAL_DUP(return_value, &CE_STATIC_MEMBERS(intern->ce)[ref->prop.offset]);
@@ -5447,8 +5449,8 @@ ZEND_METHOD(reflection_property, setValue)
}
if (Z_TYPE(CE_STATIC_MEMBERS(intern->ce)[ref->prop.offset]) == IS_UNDEF) {
- php_error_docref(NULL, E_ERROR, "Internal error: Could not find the property %s::%s", ZSTR_VAL(intern->ce->name), ZSTR_VAL(ref->prop.name));
- /* Bails out */
+ zend_throw_error(zend_ce_error, "Internal error: Could not find the property %s::%s", ZSTR_VAL(intern->ce->name), ZSTR_VAL(ref->prop.name));
+ return;
}
variable_ptr = &CE_STATIC_MEMBERS(intern->ce)[ref->prop.offset];
if (variable_ptr != value) {