summaryrefslogtreecommitdiff
path: root/Zend/zend_reflection_api.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@php.net>2005-05-26 13:46:17 +0000
committerDmitry Stogov <dmitry@php.net>2005-05-26 13:46:17 +0000
commit1a7234132850e750a167cc6195498be895b4f5aa (patch)
treeb480d2a132559695da73d8380eb92dd7e25d964c /Zend/zend_reflection_api.c
parent3453cf642adb937b45840e33c9da5961a57e8b52 (diff)
downloadphp-git-1a7234132850e750a167cc6195498be895b4f5aa.tar.gz
Added array type hinting. (This patch requires full re-make)
Diffstat (limited to 'Zend/zend_reflection_api.c')
-rw-r--r--Zend/zend_reflection_api.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/Zend/zend_reflection_api.c b/Zend/zend_reflection_api.c
index aeee738af8..050744b6b5 100644
--- a/Zend/zend_reflection_api.c
+++ b/Zend/zend_reflection_api.c
@@ -519,6 +519,11 @@ static void _parameter_string(string *str, zend_function *fptr, struct _zend_arg
if (arg_info->allow_null) {
string_printf(str, "or NULL ");
}
+ } else if (arg_info->array_type_hint) {
+ string_printf(str, "array ");
+ if (arg_info->allow_null) {
+ string_printf(str, "or NULL ");
+ }
}
if (arg_info->pass_by_reference) {
string_write(str, "&", sizeof("&")-1);
@@ -1716,6 +1721,20 @@ ZEND_METHOD(reflection_parameter, getClass)
}
/* }}} */
+/* {{{ proto public bool ReflectionParameter::isArray()
+ Returns whether parameter MUST be an array */
+ZEND_METHOD(reflection_parameter, isArray)
+{
+ reflection_object *intern;
+ parameter_reference *param;
+
+ METHOD_NOTSTATIC_NUMPARAMS(0);
+ GET_REFLECTION_OBJECT_PTR(param);
+
+ RETVAL_BOOL(param->arg_info->array_type_hint);
+}
+/* }}} */
+
/* {{{ proto public bool ReflectionParameter::allowsNull()
Returns whether NULL is allowed as this parameters's value */
ZEND_METHOD(reflection_parameter, allowsNull)
@@ -3852,6 +3871,7 @@ static zend_function_entry reflection_parameter_functions[] = {
ZEND_ME(reflection_parameter, getName, NULL, 0)
ZEND_ME(reflection_parameter, isPassedByReference, NULL, 0)
ZEND_ME(reflection_parameter, getClass, NULL, 0)
+ ZEND_ME(reflection_parameter, isArray, NULL, 0)
ZEND_ME(reflection_parameter, allowsNull, NULL, 0)
ZEND_ME(reflection_parameter, isOptional, NULL, 0)
ZEND_ME(reflection_parameter, isDefaultValueAvailable, NULL, 0)