@@ -2488,6 +2488,37 @@ ZEND_METHOD(reflection_parameter, getClass)
24882488}
24892489/* }}} */
24902490
2491+ /* {{{ proto public string ReflectionParameter::getClassName()
2492+ Returns this parameters's class name or null if this there is none */
2493+ ZEND_METHOD (reflection_parameter , getClassName )
2494+ {
2495+ reflection_object * intern ;
2496+ parameter_reference * param ;
2497+
2498+ if (zend_parse_parameters_none () == FAILURE ) {
2499+ return ;
2500+ }
2501+ GET_REFLECTION_OBJECT_PTR (param );
2502+
2503+ if (param -> arg_info -> class_name ) {
2504+ const char * class_name ;
2505+ size_t class_name_len ;
2506+
2507+ if (param -> fptr -> type == ZEND_INTERNAL_FUNCTION ) {
2508+ class_name = ((zend_internal_arg_info * )param -> arg_info )-> class_name ;
2509+ class_name_len = strlen (class_name );
2510+
2511+ RETURN_STRINGL (class_name , class_name_len );
2512+ } else {
2513+ class_name = param -> arg_info -> class_name -> val ;
2514+ class_name_len = param -> arg_info -> class_name -> len ;
2515+
2516+ RETURN_STR (param -> arg_info -> class_name );
2517+ }
2518+ }
2519+ }
2520+ /* }}} */
2521+
24912522/* {{{ proto public bool ReflectionParameter::isArray()
24922523 Returns whether parameter MUST be an array */
24932524ZEND_METHOD (reflection_parameter , isArray )
@@ -6075,6 +6106,7 @@ static const zend_function_entry reflection_parameter_functions[] = {
60756106 ZEND_ME (reflection_parameter , getDeclaringFunction , arginfo_reflection__void , 0 )
60766107 ZEND_ME (reflection_parameter , getDeclaringClass , arginfo_reflection__void , 0 )
60776108 ZEND_ME (reflection_parameter , getClass , arginfo_reflection__void , 0 )
6109+ ZEND_ME (reflection_parameter , getClassName , arginfo_reflection__void , 0 )
60786110 ZEND_ME (reflection_parameter , isArray , arginfo_reflection__void , 0 )
60796111 ZEND_ME (reflection_parameter , isCallable , arginfo_reflection__void , 0 )
60806112 ZEND_ME (reflection_parameter , allowsNull , arginfo_reflection__void , 0 )
0 commit comments