cvs: ZendEngine2 / zend_reflection_api.c

From: Date: Mon, 02 Aug 2004 23:10:30 +0000
Subject: cvs: ZendEngine2 / zend_reflection_api.c
Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-2841@lists.php.net to get a copy of this message
helly Mon Aug 2 19:10:30 2004 EDT Modified files: /ZendEngine2 zend_reflection_api.c Log: - Add methods to check parameter count http://cvs.php.net/diff.php/ZendEngine2/zend_reflection_api.c?r1=1.117&r2=1.118&ty=u Index: ZendEngine2/zend_reflection_api.c diff -u ZendEngine2/zend_reflection_api.c:1.117 ZendEngine2/zend_reflection_api.c:1.118 --- ZendEngine2/zend_reflection_api.c:1.117 Sun Jul 25 14:20:33 2004 +++ ZendEngine2/zend_reflection_api.c Mon Aug 2 19:10:29 2004 @@ -19,7 +19,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_reflection_api.c,v 1.117 2004/07/25 18:20:33 helly Exp $ */ +/* $Id: zend_reflection_api.c,v 1.118 2004/08/02 23:10:29 helly Exp $ */ #include "zend.h" #include "zend_API.h" #include "zend_exceptions.h" @@ -1366,6 +1366,34 @@ } /* }}} */ +/* {{{ proto public bool ReflectionFunction::getNumberOfParameters() + Gets the number of required parameters */ +ZEND_METHOD(reflection_function, getNumberOfParameters) +{ + reflection_object *intern; + zend_function *fptr; + + METHOD_NOTSTATIC; + GET_REFLECTION_OBJECT_PTR(fptr); + + RETURN_LONG(fptr->common.num_args); +} +/* }}} */ + +/* {{{ proto public bool ReflectionFunction::getNumberOfRequiredParameters() + Gets the number of required parameters */ +ZEND_METHOD(reflection_function, getNumberOfRequiredParameters) +{ + reflection_object *intern; + zend_function *fptr; + + METHOD_NOTSTATIC; + GET_REFLECTION_OBJECT_PTR(fptr); + + RETURN_LONG(fptr->common.required_num_args); +} +/* }}} */ + /* {{{ proto public ReflectionParameter[] Reflection_Function::getParameters() Returns an array of parameter objects for this function */ ZEND_METHOD(reflection_function, getParameters) @@ -3264,6 +3292,8 @@ ZEND_ME(reflection_function, invoke, NULL, 0) ZEND_ME(reflection_function, returnsReference, NULL, 0) ZEND_ME(reflection_function, getParameters, NULL, 0) + ZEND_ME(reflection_function, getNumberOfParameters, NULL, 0) + ZEND_ME(reflection_function, getNumberOfRequiredParameters, NULL, 0) {NULL, NULL, NULL} };

« previous php.zend-engine.cvs (#2841) next »