diff options
author | Felipe Pena <felipe@php.net> | 2009-01-07 22:40:17 +0000 |
---|---|---|
committer | Felipe Pena <felipe@php.net> | 2009-01-07 22:40:17 +0000 |
commit | 15851cd771e1e9ff5ed7d505ad1ef25fc912957b (patch) | |
tree | 283bb6905f1706de35ebf6c6e405daa5bd15bdc3 /ext/reflection/php_reflection.c | |
parent | 93adc26ed775a02c96c50ddbabba782596ba3171 (diff) | |
download | php-git-15851cd771e1e9ff5ed7d505ad1ef25fc912957b.tar.gz |
MFH:
- New parameter parsing
- Removed METHOD_NOTSTATIC_NUMPARAMS
Diffstat (limited to 'ext/reflection/php_reflection.c')
-rw-r--r-- | ext/reflection/php_reflection.c | 285 |
1 files changed, 208 insertions, 77 deletions
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 74b7cbfb27..859b9a93ed 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -83,11 +83,6 @@ ZEND_DECLARE_MODULE_GLOBALS(reflection) return; \ } \ -#define METHOD_NOTSTATIC_NUMPARAMS(ce, c) METHOD_NOTSTATIC(ce) \ - if (ZEND_NUM_ARGS() > c) { \ - ZEND_WRONG_PARAM_COUNT(); \ - } \ - /* Exception throwing macro */ #define _DO_THROW(msg) \ zend_throw_exception(reflection_exception_ptr, msg, 0 TSRMLS_CC); \ @@ -1114,7 +1109,9 @@ static void _function_check_flag(INTERNAL_FUNCTION_PARAMETERS, int mask) reflection_object *intern; zend_function *mptr; - METHOD_NOTSTATIC_NUMPARAMS(reflection_method_ptr, 0); + if (zend_parse_parameters_none() == FAILURE) { + return; + } GET_REFLECTION_OBJECT_PTR(mptr); RETURN_BOOL(mptr->common.fn_flags & mask); } @@ -1527,7 +1524,9 @@ ZEND_METHOD(reflection_function, __toString) string str; zval* name; - METHOD_NOTSTATIC_NUMPARAMS(reflection_function_abstract_ptr, 0); + if (zend_parse_parameters_none() == FAILURE) { + return; + } GET_REFLECTION_OBJECT_PTR(fptr); _default_lookup_entry(getThis(), "name", sizeof("name"), &name TSRMLS_CC); string_init(&str); @@ -1540,7 +1539,9 @@ ZEND_METHOD(reflection_function, __toString) Returns this function's name */ ZEND_METHOD(reflection_function, getName) { - METHOD_NOTSTATIC_NUMPARAMS(reflection_function_abstract_ptr, 0); + if (zend_parse_parameters_none() == FAILURE) { + return; + } _default_get_entry(getThis(), "name", sizeof("name"), return_value TSRMLS_CC); } /* }}} */ @@ -1552,7 +1553,9 @@ ZEND_METHOD(reflection_function, isClosure) reflection_object *intern; zend_function *fptr; - METHOD_NOTSTATIC_NUMPARAMS(reflection_function_abstract_ptr, 0); + if (zend_parse_parameters_none() == FAILURE) { + return; + } GET_REFLECTION_OBJECT_PTR(fptr); RETURN_BOOL(intern->obj); } @@ -1566,7 +1569,9 @@ ZEND_METHOD(reflection_function, getClosureThis) zend_function *fptr; zval* closure_this; - METHOD_NOTSTATIC_NUMPARAMS(reflection_function_abstract_ptr, 0); + if (zend_parse_parameters_none() == FAILURE) { + return; + } GET_REFLECTION_OBJECT_PTR(fptr); if (intern->obj) { closure_this = zend_get_closure_this_ptr(intern->obj TSRMLS_CC); @@ -1584,7 +1589,9 @@ ZEND_METHOD(reflection_function, isInternal) reflection_object *intern; zend_function *fptr; - METHOD_NOTSTATIC_NUMPARAMS(reflection_function_abstract_ptr, 0); + if (zend_parse_parameters_none() == FAILURE) { + return; + } GET_REFLECTION_OBJECT_PTR(fptr); RETURN_BOOL(fptr->type == ZEND_INTERNAL_FUNCTION); } @@ -1597,7 +1604,9 @@ ZEND_METHOD(reflection_function, isUserDefined) reflection_object *intern; zend_function *fptr; - METHOD_NOTSTATIC_NUMPARAMS(reflection_function_abstract_ptr, 0); + if (zend_parse_parameters_none() == FAILURE) { + return; + } GET_REFLECTION_OBJECT_PTR(fptr); RETURN_BOOL(fptr->type == ZEND_USER_FUNCTION); } @@ -1623,7 +1632,9 @@ ZEND_METHOD(reflection_function, getFileName) reflection_object *intern; zend_function *fptr; - METHOD_NOTSTATIC_NUMPARAMS(reflection_function_abstract_ptr, 0); + if (zend_parse_parameters_none() == FAILURE) { + return; + } GET_REFLECTION_OBJECT_PTR(fptr); if (fptr->type == ZEND_USER_FUNCTION) { RETURN_STRING(fptr->op_array.filename, 1); @@ -1639,7 +1650,9 @@ ZEND_METHOD(reflection_function, getStartLine) reflection_object *intern; zend_function *fptr; - METHOD_NOTSTATIC_NUMPARAMS(reflection_function_abstract_ptr, 0); + if (zend_parse_parameters_none() == FAILURE) { + return; + } GET_REFLECTION_OBJECT_PTR(fptr); if (fptr->type == ZEND_USER_FUNCTION) { RETURN_LONG(fptr->op_array.line_start); @@ -1655,7 +1668,9 @@ ZEND_METHOD(reflection_function, getEndLine) reflection_object *intern; zend_function *fptr; - METHOD_NOTSTATIC_NUMPARAMS(reflection_function_abstract_ptr, 0); + if (zend_parse_parameters_none() == FAILURE) { + return; + } GET_REFLECTION_OBJECT_PTR(fptr); if (fptr->type == ZEND_USER_FUNCTION) { RETURN_LONG(fptr->op_array.line_end); @@ -1671,7 +1686,9 @@ ZEND_METHOD(reflection_function, getDocComment) reflection_object *intern; zend_function *fptr; - METHOD_NOTSTATIC_NUMPARAMS(reflection_function_abstract_ptr, 0); + if (zend_parse_parameters_none() == FAILURE) { + return; + } GET_REFLECTION_OBJECT_PTR(fptr); if (fptr->type == ZEND_USER_FUNCTION && fptr->op_array.doc_comment) { RETURN_STRINGL(fptr->op_array.doc_comment, fptr->op_array.doc_comment_len, 1); @@ -1688,7 +1705,9 @@ ZEND_METHOD(reflection_function, getStaticVariables) reflection_object *intern; zend_function *fptr; - METHOD_NOTSTATIC_NUMPARAMS(reflection_function_abstract_ptr, 0); + if (zend_parse_parameters_none() == FAILURE) { + return; + } GET_REFLECTION_OBJECT_PTR(fptr); /* Return an empty array in case no static variables exist */ @@ -1707,7 +1726,9 @@ ZEND_METHOD(reflection_function, getClosure) reflection_object *intern; zend_function *fptr; - METHOD_NOTSTATIC_NUMPARAMS(reflection_function_ptr, 0); + if (zend_parse_parameters_none() == FAILURE) { + return; + } GET_REFLECTION_OBJECT_PTR(fptr); zend_create_closure(return_value, fptr, NULL, NULL TSRMLS_CC); @@ -2126,7 +2147,9 @@ ZEND_METHOD(reflection_parameter, __toString) parameter_reference *param; string str; - METHOD_NOTSTATIC_NUMPARAMS(reflection_parameter_ptr, 0); + if (zend_parse_parameters_none() == FAILURE) { + return; + } GET_REFLECTION_OBJECT_PTR(param); string_init(&str); _parameter_string(&str, param->fptr, param->arg_info, param->offset, param->required, "" TSRMLS_CC); @@ -2138,7 +2161,9 @@ ZEND_METHOD(reflection_parameter, __toString) Returns this parameters's name */ ZEND_METHOD(reflection_parameter, getName) { - METHOD_NOTSTATIC_NUMPARAMS(reflection_parameter_ptr, 0); + if (zend_parse_parameters_none() == FAILURE) { + return; + } _default_get_entry(getThis(), "name", sizeof("name"), return_value TSRMLS_CC); } /* }}} */ @@ -2150,7 +2175,9 @@ ZEND_METHOD(reflection_parameter, getDeclaringFunction) reflection_object *intern; parameter_reference *param; - METHOD_NOTSTATIC_NUMPARAMS(reflection_parameter_ptr, 0); + if (zend_parse_parameters_none() == FAILURE) { + return; + } GET_REFLECTION_OBJECT_PTR(param); if (!param->fptr->common.scope) { @@ -2168,7 +2195,9 @@ ZEND_METHOD(reflection_parameter, getDeclaringClass) reflection_object *intern; parameter_reference *param; - METHOD_NOTSTATIC_NUMPARAMS(reflection_parameter_ptr, 0); + if (zend_parse_parameters_none() == FAILURE) { + return; + } GET_REFLECTION_OBJECT_PTR(param); if (param->fptr->common.scope) { @@ -2185,7 +2214,9 @@ ZEND_METHOD(reflection_parameter, getClass) parameter_reference *param; zend_class_entry **pce, *ce; - METHOD_NOTSTATIC_NUMPARAMS(reflection_parameter_ptr, 0); + if (zend_parse_parameters_none() == FAILURE) { + return; + } GET_REFLECTION_OBJECT_PTR(param); if (param->arg_info->class_name) { @@ -2239,7 +2270,9 @@ ZEND_METHOD(reflection_parameter, isArray) reflection_object *intern; parameter_reference *param; - METHOD_NOTSTATIC_NUMPARAMS(reflection_parameter_ptr, 0); + if (zend_parse_parameters_none() == FAILURE) { + return; + } GET_REFLECTION_OBJECT_PTR(param); RETVAL_BOOL(param->arg_info->array_type_hint); @@ -2253,7 +2286,9 @@ ZEND_METHOD(reflection_parameter, allowsNull) reflection_object *intern; parameter_reference *param; - METHOD_NOTSTATIC_NUMPARAMS(reflection_parameter_ptr, 0); + if (zend_parse_parameters_none() == FAILURE) { + return; + } GET_REFLECTION_OBJECT_PTR(param); RETVAL_BOOL(param->arg_info->allow_null); @@ -2267,7 +2302,9 @@ ZEND_METHOD(reflection_parameter, isPassedByReference) reflection_object *intern; parameter_reference *param; - METHOD_NOTSTATIC_NUMPARAMS(reflection_parameter_ptr, 0); + if (zend_parse_parameters_none() == FAILURE) { + return; + } GET_REFLECTION_OBJECT_PTR(param); RETVAL_BOOL(param->arg_info->pass_by_reference); @@ -2281,7 +2318,9 @@ ZEND_METHOD(reflection_parameter, getPosition) reflection_object *intern; parameter_reference *param; - METHOD_NOTSTATIC_NUMPARAMS(reflection_parameter_ptr, 0); + if (zend_parse_parameters_none() == FAILURE) { + return; + } GET_REFLECTION_OBJECT_PTR(param); RETVAL_LONG(param->offset); @@ -2295,7 +2334,9 @@ ZEND_METHOD(reflection_parameter, isOptional) reflection_object *intern; parameter_reference *param; - METHOD_NOTSTATIC_NUMPARAMS(reflection_parameter_ptr, 0); + if (zend_parse_parameters_none() == FAILURE) { + return; + } GET_REFLECTION_OBJECT_PTR(param); RETVAL_BOOL(param->offset >= param->required); @@ -2310,7 +2351,9 @@ ZEND_METHOD(reflection_parameter, isDefaultValueAvailable) parameter_reference *param; zend_op *precv; - METHOD_NOTSTATIC_NUMPARAMS(reflection_parameter_ptr, 0); + if (zend_parse_parameters_none() == FAILURE) { + return; + } GET_REFLECTION_OBJECT_PTR(param); if (param->fptr->type != ZEND_USER_FUNCTION) @@ -2336,7 +2379,9 @@ ZEND_METHOD(reflection_parameter, getDefaultValue) parameter_reference *param; zend_op *precv; - METHOD_NOTSTATIC_NUMPARAMS(reflection_parameter_ptr, 0); + if (zend_parse_parameters_none() == FAILURE) { + return; + } GET_REFLECTION_OBJECT_PTR(param); if (param->fptr->type != ZEND_USER_FUNCTION) @@ -2514,7 +2559,9 @@ ZEND_METHOD(reflection_method, __toString) string str; zval *name; - METHOD_NOTSTATIC_NUMPARAMS(reflection_method_ptr, 0); + if (zend_parse_parameters_none() == FAILURE) { + return; + } GET_REFLECTION_OBJECT_PTR(mptr); _default_lookup_entry(getThis(), "name", sizeof("name"), &name TSRMLS_CC); string_init(&str); @@ -2829,7 +2876,9 @@ ZEND_METHOD(reflection_function, inNamespace) zval **name; char *colon; - METHOD_NOTSTATIC_NUMPARAMS(reflection_function_abstract_ptr, 0); + if (zend_parse_parameters_none() == FAILURE) { + return; + } if (zend_hash_find(Z_OBJPROP_P(getThis()), "name", sizeof("name"), (void **) &name) == FAILURE) { RETURN_FALSE; } @@ -2850,7 +2899,9 @@ ZEND_METHOD(reflection_function, getNamespaceName) zval **name; char *backslash; - METHOD_NOTSTATIC_NUMPARAMS(reflection_function_abstract_ptr, 0); + if (zend_parse_parameters_none() == FAILURE) { + return; + } if (zend_hash_find(Z_OBJPROP_P(getThis()), "name", sizeof("name"), (void **) &name) == FAILURE) { RETURN_FALSE; } @@ -2871,7 +2922,9 @@ ZEND_METHOD(reflection_function, getShortName) zval **name; char *backslash; - METHOD_NOTSTATIC_NUMPARAMS(reflection_function_abstract_ptr, 0); + if (zend_parse_parameters_none() == FAILURE) { + return; + } if (zend_hash_find(Z_OBJPROP_P(getThis()), "name", sizeof("name"), (void **) &name) == FAILURE) { RETURN_FALSE; } @@ -2892,7 +2945,9 @@ ZEND_METHOD(reflection_method, isConstructor) reflection_object *intern; zend_function *mptr; - METHOD_NOTSTATIC_NUMPARAMS(reflection_method_ptr, 0); + if (zend_parse_parameters_none() == FAILURE) { + return; + } GET_REFLECTION_OBJECT_PTR(mptr); /* we need to check if the ctor is the ctor of the class level we we * looking at since we might be looking at an inherited old style ctor @@ -2908,7 +2963,9 @@ ZEND_METHOD(reflection_method, isDestructor) reflection_object *intern; zend_function *mptr; - METHOD_NOTSTATIC_NUMPARAMS(reflection_method_ptr, 0); + if (zend_parse_parameters_none() == FAILURE) { + return; + } GET_REFLECTION_OBJECT_PTR(mptr); RETURN_BOOL(mptr->common.fn_flags & ZEND_ACC_DTOR); } @@ -2921,7 +2978,9 @@ ZEND_METHOD(reflection_method, getModifiers) reflection_object *intern; zend_function *mptr; - METHOD_NOTSTATIC_NUMPARAMS(reflection_method_ptr, 0); + if (zend_parse_parameters_none() == FAILURE) { + return; + } GET_REFLECTION_OBJECT_PTR(mptr); RETURN_LONG(mptr->common.fn_flags); @@ -3040,7 +3099,9 @@ ZEND_METHOD(reflection_class, getStaticProperties) HashPosition pos; zval **value; - METHOD_NOTSTATIC_NUMPARAMS(reflection_class_ptr, 0); + if (zend_parse_parameters_none() == FAILURE) { + return; + } GET_REFLECTION_OBJECT_PTR(ce); zend_update_class_constants(ce TSRMLS_CC); @@ -3145,7 +3206,9 @@ ZEND_METHOD(reflection_class, getDefaultProperties) int count, i; HashTable *ht_list[3]; - METHOD_NOTSTATIC_NUMPARAMS(reflection_class_ptr, 0); + if (zend_parse_parameters_none() == FAILURE) { + return; + } GET_REFLECTION_OBJECT_PTR(ce); array_init(return_value); @@ -3198,7 +3261,9 @@ ZEND_METHOD(reflection_class, __toString) zend_class_entry *ce; string str; - METHOD_NOTSTATIC_NUMPARAMS(reflection_class_ptr, 0); + if (zend_parse_parameters_none() == FAILURE) { + return; + } GET_REFLECTION_OBJECT_PTR(ce); string_init(&str); _class_string(&str, ce, intern->obj, "" TSRMLS_CC); @@ -3210,7 +3275,9 @@ ZEND_METHOD(reflection_class, __toString) Returns the class' name */ ZEND_METHOD(reflection_class, getName) { - METHOD_NOTSTATIC_NUMPARAMS(reflection_class_ptr, 0); + if (zend_parse_parameters_none() == FAILURE) { + return; + } _default_get_entry(getThis(), "name", sizeof("name"), return_value TSRMLS_CC); } /* }}} */ @@ -3222,7 +3289,9 @@ ZEND_METHOD(reflection_class, isInternal) reflection_object *intern; zend_class_entry *ce; - METHOD_NOTSTATIC_NUMPARAMS(reflection_class_ptr, 0); + if (zend_parse_parameters_none() == FAILURE) { + return; + } GET_REFLECTION_OBJECT_PTR(ce); RETURN_BOOL(ce->type == ZEND_INTERNAL_CLASS); } @@ -3235,7 +3304,9 @@ ZEND_METHOD(reflection_class, isUserDefined) reflection_object *intern; zend_class_entry *ce; - METHOD_NOTSTATIC_NUMPARAMS(reflection_class_ptr, 0); + if (zend_parse_parameters_none() == FAILURE) { + return; + } GET_REFLECTION_OBJECT_PTR(ce); RETURN_BOOL(ce->type == ZEND_USER_CLASS); } @@ -3248,7 +3319,9 @@ ZEND_METHOD(reflection_class, getFileName) reflection_object *intern; zend_class_entry *ce; - METHOD_NOTSTATIC_NUMPARAMS(reflection_class_ptr, 0); + if (zend_parse_parameters_none() == FAILURE) { + return; + } GET_REFLECTION_OBJECT_PTR(ce); if (ce->type == ZEND_USER_CLASS) { RETURN_STRING(ce->filename, 1); @@ -3264,7 +3337,9 @@ ZEND_METHOD(reflection_class, getStartLine) reflection_object *intern; zend_class_entry *ce; - METHOD_NOTSTATIC_NUMPARAMS(reflection_class_ptr, 0); + if (zend_parse_parameters_none() == FAILURE) { + return; + } GET_REFLECTION_OBJECT_PTR(ce); if (ce->type == ZEND_USER_FUNCTION) { RETURN_LONG(ce->line_start); @@ -3280,7 +3355,9 @@ ZEND_METHOD(reflection_class, getEndLine) reflection_object *intern; zend_class_entry *ce; - METHOD_NOTSTATIC_NUMPARAMS(reflection_class_ptr, 0); + if (zend_parse_parameters_none() == FAILURE) { + return; + } GET_REFLECTION_OBJECT_PTR(ce); if (ce->type == ZEND_USER_CLASS) { RETURN_LONG(ce->line_end); @@ -3296,7 +3373,9 @@ ZEND_METHOD(reflection_class, getDocComment) reflection_object *intern; zend_class_entry *ce; - METHOD_NOTSTATIC_NUMPARAMS(reflection_class_ptr, 0); + if (zend_parse_parameters_none() == FAILURE) { + return; + } GET_REFLECTION_OBJECT_PTR(ce); if (ce->type == ZEND_USER_CLASS && ce->doc_comment) { RETURN_STRINGL(ce->doc_comment, ce->doc_comment_len, 1); @@ -3312,7 +3391,9 @@ ZEND_METHOD(reflection_class, getConstructor) reflection_object *intern; zend_class_entry *ce; - METHOD_NOTSTATIC_NUMPARAMS(reflection_class_ptr, 0); + if (zend_parse_parameters_none() == FAILURE) { + return; + } GET_REFLECTION_OBJECT_PTR(ce); if (ce->constructor) { @@ -3657,7 +3738,9 @@ ZEND_METHOD(reflection_class, getConstants) reflection_object *intern; zend_class_entry *ce; - METHOD_NOTSTATIC_NUMPARAMS(reflection_class_ptr, 0); + if (zend_parse_parameters_none() == FAILURE) { + return; + } GET_REFLECTION_OBJECT_PTR(ce); array_init(return_value); zend_hash_apply_with_argument(&ce->constants_table, (apply_func_arg_t) zval_update_constant, (void*)1 TSRMLS_CC); @@ -3697,7 +3780,9 @@ static void _class_check_flag(INTERNAL_FUNCTION_PARAMETERS, int mask) reflection_object *intern; zend_class_entry *ce; - METHOD_NOTSTATIC_NUMPARAMS(reflection_class_ptr, 0); + if (zend_parse_parameters_none() == FAILURE) { + return; + } GET_REFLECTION_OBJECT_PTR(ce); RETVAL_BOOL(ce->ce_flags & mask); } @@ -3710,7 +3795,9 @@ ZEND_METHOD(reflection_class, isInstantiable) reflection_object *intern; zend_class_entry *ce; - METHOD_NOTSTATIC_NUMPARAMS(reflection_class_ptr, 0); + if (zend_parse_parameters_none() == FAILURE) { + return; + } GET_REFLECTION_OBJECT_PTR(ce); if (ce->ce_flags & (ZEND_ACC_INTERFACE | ZEND_ACC_EXPLICIT_ABSTRACT_CLASS | ZEND_ACC_IMPLICIT_ABSTRACT_CLASS)) { RETURN_FALSE; @@ -3757,7 +3844,9 @@ ZEND_METHOD(reflection_class, getModifiers) reflection_object *intern; zend_class_entry *ce; - METHOD_NOTSTATIC_NUMPARAMS(reflection_class_ptr, 0); + if (zend_parse_parameters_none() == FAILURE) { + return; + } GET_REFLECTION_OBJECT_PTR(ce); RETURN_LONG(ce->ce_flags); @@ -3940,7 +4029,9 @@ ZEND_METHOD(reflection_class, getInterfaces) reflection_object *intern; zend_class_entry *ce; - METHOD_NOTSTATIC_NUMPARAMS(reflection_class_ptr, 0); + if (zend_parse_parameters_none() == FAILURE) { + return; + } GET_REFLECTION_OBJECT_PTR(ce); /* Return an empty array if this class implements no interfaces */ @@ -3967,7 +4058,9 @@ ZEND_METHOD(reflection_class, getInterfaceNames) zend_class_entry *ce; zend_uint i; - METHOD_NOTSTATIC_NUMPARAMS(reflection_class_ptr, 0); + if (zend_parse_parameters_none() == FAILURE) { + return; + } GET_REFLECTION_OBJECT_PTR(ce); /* Return an empty array if this class implements no interfaces */ @@ -3986,7 +4079,9 @@ ZEND_METHOD(reflection_class, getParentClass) reflection_object *intern; zend_class_entry *ce; - METHOD_NOTSTATIC_NUMPARAMS(reflection_class_ptr, 0); + if (zend_parse_parameters_none() == FAILURE) { + return; + } GET_REFLECTION_OBJECT_PTR(ce); if (ce->parent) { @@ -4147,7 +4242,9 @@ ZEND_METHOD(reflection_class, inNamespace) zval **name; char *colon; - METHOD_NOTSTATIC_NUMPARAMS(reflection_class_ptr, 0); + if (zend_parse_parameters_none() == FAILURE) { + return; + } if (zend_hash_find(Z_OBJPROP_P(getThis()), "name", sizeof("name"), (void **) &name) == FAILURE) { RETURN_FALSE; } @@ -4168,7 +4265,9 @@ ZEND_METHOD(reflection_class, getNamespaceName) zval **name; char *backslash; - METHOD_NOTSTATIC_NUMPARAMS(reflection_class_ptr, 0); + if (zend_parse_parameters_none() == FAILURE) { + return; + } if (zend_hash_find(Z_OBJPROP_P(getThis()), "name", sizeof("name"), (void **) &name) == FAILURE) { RETURN_FALSE; } @@ -4189,7 +4288,9 @@ ZEND_METHOD(reflection_class, getShortName) zval **name; char *backslash; - METHOD_NOTSTATIC_NUMPARAMS(reflection_class_ptr, 0); + if (zend_parse_parameters_none() == FAILURE) { + return; + } if (zend_hash_find(Z_OBJPROP_P(getThis()), "name", sizeof("name"), (void **) &name) == FAILURE) { RETURN_FALSE; } @@ -4336,7 +4437,9 @@ ZEND_METHOD(reflection_property, __toString) property_reference *ref; string str; - METHOD_NOTSTATIC_NUMPARAMS(reflection_property_ptr, 0); + if (zend_parse_parameters_none() == FAILURE) { + return; + } GET_REFLECTION_OBJECT_PTR(ref); string_init(&str); _property_string(&str, &ref->prop, NULL, "" TSRMLS_CC); @@ -4348,7 +4451,9 @@ ZEND_METHOD(reflection_property, __toString) Returns the class' name */ ZEND_METHOD(reflection_property, getName) { - METHOD_NOTSTATIC_NUMPARAMS(reflection_property_ptr, 0); + if (zend_parse_parameters_none() == FAILURE) { + return; + } _default_get_entry(getThis(), "name", sizeof("name"), return_value TSRMLS_CC); } /* }}} */ @@ -4358,7 +4463,9 @@ static void _property_check_flag(INTERNAL_FUNCTION_PARAMETERS, int mask) reflection_object *intern; property_reference *ref; - METHOD_NOTSTATIC_NUMPARAMS(reflection_property_ptr, 0); + if (zend_parse_parameters_none() == FAILURE) { + return; + } GET_REFLECTION_OBJECT_PTR(ref); RETURN_BOOL(ref->prop.flags & mask); } @@ -4410,7 +4517,9 @@ ZEND_METHOD(reflection_property, getModifiers) reflection_object *intern; property_reference *ref; - METHOD_NOTSTATIC_NUMPARAMS(reflection_property_ptr, 0); + if (zend_parse_parameters_none() == FAILURE) { + return; + } GET_REFLECTION_OBJECT_PTR(ref); RETURN_LONG(ref->prop.flags); @@ -4547,7 +4656,9 @@ ZEND_METHOD(reflection_property, getDeclaringClass) char *prop_name, *class_name; int prop_name_len; - METHOD_NOTSTATIC_NUMPARAMS(reflection_property_ptr, 0); + if (zend_parse_parameters_none() == FAILURE) { + return; + } GET_REFLECTION_OBJECT_PTR(ref); if (zend_unmangle_property_name(ref->prop.name, ref->prop.name_length, &class_name, &prop_name) != SUCCESS) { @@ -4576,7 +4687,9 @@ ZEND_METHOD(reflection_property, getDocComment) reflection_object *intern; property_reference *ref; - METHOD_NOTSTATIC_NUMPARAMS(reflection_property_ptr, 0); + if (zend_parse_parameters_none() == FAILURE) { + return; + } GET_REFLECTION_OBJECT_PTR(ref); if (ref->prop.doc_comment) { RETURN_STRINGL(ref->prop.doc_comment, ref->prop.doc_comment_len, 1); @@ -4593,12 +4706,10 @@ ZEND_METHOD(reflection_property, setAccessible) property_reference *ref; zend_bool visible; - METHOD_NOTSTATIC_NUMPARAMS(reflection_property_ptr, 1); - GET_REFLECTION_OBJECT_PTR(ref); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "b", &visible) == FAILURE) { return; } + GET_REFLECTION_OBJECT_PTR(ref); ref->ignore_visibility = visible; } /* }}} */ @@ -4659,7 +4770,9 @@ ZEND_METHOD(reflection_extension, __toString) zend_module_entry *module; string str; - METHOD_NOTSTATIC_NUMPARAMS(reflection_extension_ptr, 0); + if (zend_parse_parameters_none() == FAILURE) { + return; + } GET_REFLECTION_OBJECT_PTR(module); string_init(&str); _extension_string(&str, module, "" TSRMLS_CC); @@ -4671,7 +4784,9 @@ ZEND_METHOD(reflection_extension, __toString) Returns this extension's name */ ZEND_METHOD(reflection_extension, getName) { - METHOD_NOTSTATIC_NUMPARAMS(reflection_extension_ptr, 0); + if (zend_parse_parameters_none() == FAILURE) { + return; + } _default_get_entry(getThis(), "name", sizeof("name"), return_value TSRMLS_CC); } /* }}} */ @@ -4683,7 +4798,9 @@ ZEND_METHOD(reflection_extension, getVersion) reflection_object *intern; zend_module_entry *module; - METHOD_NOTSTATIC_NUMPARAMS(reflection_extension_ptr, 0); + if (zend_parse_parameters_none() == FAILURE) { + return; + } GET_REFLECTION_OBJECT_PTR(module); /* An extension does not necessarily have a version number */ @@ -4702,7 +4819,9 @@ ZEND_METHOD(reflection_extension, getFunctions) reflection_object *intern; zend_module_entry *module; - METHOD_NOTSTATIC_NUMPARAMS(reflection_extension_ptr, 0); + if (zend_parse_parameters_none() == FAILURE) { + return; + } GET_REFLECTION_OBJECT_PTR(module); array_init(return_value); @@ -4751,7 +4870,9 @@ ZEND_METHOD(reflection_extension, getConstants) reflection_object *intern; zend_module_entry *module; - METHOD_NOTSTATIC_NUMPARAMS(reflection_extension_ptr, 0); + if (zend_parse_parameters_none() == FAILURE) { + return; + } GET_REFLECTION_OBJECT_PTR(module); array_init(return_value); @@ -4783,7 +4904,9 @@ ZEND_METHOD(reflection_extension, getINIEntries) reflection_object *intern; zend_module_entry *module; - METHOD_NOTSTATIC_NUMPARAMS(reflection_extension_ptr, 0); + if (zend_parse_parameters_none() == FAILURE) { + return; + } GET_REFLECTION_OBJECT_PTR(module); array_init(return_value); @@ -4818,7 +4941,9 @@ ZEND_METHOD(reflection_extension, getClasses) reflection_object *intern; zend_module_entry *module; - METHOD_NOTSTATIC_NUMPARAMS(reflection_extension_ptr, 0); + if (zend_parse_parameters_none() == FAILURE) { + return; + } GET_REFLECTION_OBJECT_PTR(module); array_init(return_value); @@ -4833,7 +4958,9 @@ ZEND_METHOD(reflection_extension, getClassNames) reflection_object *intern; zend_module_entry *module; - METHOD_NOTSTATIC_NUMPARAMS(reflection_extension_ptr, 0); + if (zend_parse_parameters_none() == FAILURE) { + return; + } GET_REFLECTION_OBJECT_PTR(module); array_init(return_value); @@ -4849,7 +4976,9 @@ ZEND_METHOD(reflection_extension, getDependencies) zend_module_entry *module; const zend_module_dep *dep; - METHOD_NOTSTATIC_NUMPARAMS(reflection_extension_ptr, 0); + if (zend_parse_parameters_none() == FAILURE) { + return; + } GET_REFLECTION_OBJECT_PTR(module); array_init(return_value); @@ -4900,7 +5029,9 @@ ZEND_METHOD(reflection_extension, info) reflection_object *intern; zend_module_entry *module; - METHOD_NOTSTATIC_NUMPARAMS(reflection_extension_ptr, 0); + if (zend_parse_parameters_none() == FAILURE) { + return; + } GET_REFLECTION_OBJECT_PTR(module); php_info_print_module(module TSRMLS_CC); |