]> granicus.if.org Git - php/commitdiff
Fixes missing Reflector interface constraints being enforced by the engine
authorTjerk Meesters <datibbaw@php.net>
Thu, 14 Aug 2014 01:25:14 +0000 (09:25 +0800)
committerTjerk Meesters <datibbaw@php.net>
Sat, 16 Aug 2014 09:34:56 +0000 (17:34 +0800)
ext/reflection/php_reflection.c
ext/reflection/tests/ReflectionClass_toString_001.phpt

index 4248de834d23fdec0d52d7d9fd28534cb0f3824e..e4ad9416f027ad67af710da26cf1559d989b7bf1 100644 (file)
@@ -261,15 +261,6 @@ static void _default_lookup_entry(zval *object, char *name, int name_len, zval *
 /* }}} */
 #endif
 
-static void reflection_register_implement(zend_class_entry *class_entry, zend_class_entry *interface_entry TSRMLS_DC) /* {{{ */
-{
-       zend_uint num_interfaces = ++class_entry->num_interfaces;
-
-       class_entry->interfaces = (zend_class_entry **) realloc(class_entry->interfaces, sizeof(zend_class_entry *) * num_interfaces);
-       class_entry->interfaces[num_interfaces - 1] = interface_entry;
-}
-/* }}} */
-
 static zend_function *_copy_function(zend_function *fptr TSRMLS_DC) /* {{{ */
 {
        if (fptr
@@ -5687,7 +5678,6 @@ ZEND_END_ARG_INFO()
 
 static const zend_function_entry reflection_function_abstract_functions[] = {
        ZEND_ME(reflection, __clone, arginfo_reflection__void, ZEND_ACC_PRIVATE|ZEND_ACC_FINAL)
-       PHP_ABSTRACT_ME(reflection_function, __toString, arginfo_reflection__void)
        ZEND_ME(reflection_function, inNamespace, arginfo_reflection__void, 0)
        ZEND_ME(reflection_function, isClosure, arginfo_reflection__void, 0)
        ZEND_ME(reflection_function, isDeprecated, arginfo_reflection__void, 0)
@@ -6094,7 +6084,7 @@ PHP_MINIT_FUNCTION(reflection) /* {{{ */
        INIT_CLASS_ENTRY(_reflection_entry, "ReflectionFunctionAbstract", reflection_function_abstract_functions);
        _reflection_entry.create_object = reflection_objects_new;
        reflection_function_abstract_ptr = zend_register_internal_class(&_reflection_entry TSRMLS_CC);
-       reflection_register_implement(reflection_function_abstract_ptr, reflector_ptr TSRMLS_CC);
+       zend_class_implements(reflection_function_abstract_ptr TSRMLS_CC, 1, reflector_ptr);
        zend_declare_property_string(reflection_function_abstract_ptr, "name", sizeof("name")-1, "", ZEND_ACC_ABSTRACT TSRMLS_CC);
 
        INIT_CLASS_ENTRY(_reflection_entry, "ReflectionFunction", reflection_function_functions);
@@ -6107,7 +6097,7 @@ PHP_MINIT_FUNCTION(reflection) /* {{{ */
        INIT_CLASS_ENTRY(_reflection_entry, "ReflectionParameter", reflection_parameter_functions);
        _reflection_entry.create_object = reflection_objects_new;
        reflection_parameter_ptr = zend_register_internal_class(&_reflection_entry TSRMLS_CC);
-       reflection_register_implement(reflection_parameter_ptr, reflector_ptr TSRMLS_CC);
+       zend_class_implements(reflection_parameter_ptr TSRMLS_CC, 1, reflector_ptr);
        zend_declare_property_string(reflection_parameter_ptr, "name", sizeof("name")-1, "", ZEND_ACC_PUBLIC TSRMLS_CC);
 
        INIT_CLASS_ENTRY(_reflection_entry, "ReflectionMethod", reflection_method_functions);
@@ -6126,7 +6116,7 @@ PHP_MINIT_FUNCTION(reflection) /* {{{ */
        INIT_CLASS_ENTRY(_reflection_entry, "ReflectionClass", reflection_class_functions);
        _reflection_entry.create_object = reflection_objects_new;
        reflection_class_ptr = zend_register_internal_class(&_reflection_entry TSRMLS_CC);
-       reflection_register_implement(reflection_class_ptr, reflector_ptr TSRMLS_CC);
+       zend_class_implements(reflection_class_ptr TSRMLS_CC, 1, reflector_ptr);
        zend_declare_property_string(reflection_class_ptr, "name", sizeof("name")-1, "", ZEND_ACC_PUBLIC TSRMLS_CC);
 
        REGISTER_REFLECTION_CLASS_CONST_LONG(class, "IS_IMPLICIT_ABSTRACT", ZEND_ACC_IMPLICIT_ABSTRACT_CLASS);
@@ -6140,7 +6130,7 @@ PHP_MINIT_FUNCTION(reflection) /* {{{ */
        INIT_CLASS_ENTRY(_reflection_entry, "ReflectionProperty", reflection_property_functions);
        _reflection_entry.create_object = reflection_objects_new;
        reflection_property_ptr = zend_register_internal_class(&_reflection_entry TSRMLS_CC);
-       reflection_register_implement(reflection_property_ptr, reflector_ptr TSRMLS_CC);
+       zend_class_implements(reflection_property_ptr TSRMLS_CC, 1, reflector_ptr);
        zend_declare_property_string(reflection_property_ptr, "name", sizeof("name")-1, "", ZEND_ACC_PUBLIC TSRMLS_CC);
        zend_declare_property_string(reflection_property_ptr, "class", sizeof("class")-1, "", ZEND_ACC_PUBLIC TSRMLS_CC);
 
@@ -6152,13 +6142,13 @@ PHP_MINIT_FUNCTION(reflection) /* {{{ */
        INIT_CLASS_ENTRY(_reflection_entry, "ReflectionExtension", reflection_extension_functions);
        _reflection_entry.create_object = reflection_objects_new;
        reflection_extension_ptr = zend_register_internal_class(&_reflection_entry TSRMLS_CC);
-       reflection_register_implement(reflection_extension_ptr, reflector_ptr TSRMLS_CC);
+       zend_class_implements(reflection_extension_ptr TSRMLS_CC, 1, reflector_ptr);
        zend_declare_property_string(reflection_extension_ptr, "name", sizeof("name")-1, "", ZEND_ACC_PUBLIC TSRMLS_CC);
 
        INIT_CLASS_ENTRY(_reflection_entry, "ReflectionZendExtension", reflection_zend_extension_functions);
        _reflection_entry.create_object = reflection_objects_new;
        reflection_zend_extension_ptr = zend_register_internal_class(&_reflection_entry TSRMLS_CC);
-       reflection_register_implement(reflection_zend_extension_ptr, reflector_ptr TSRMLS_CC);
+       zend_class_implements(reflection_zend_extension_ptr TSRMLS_CC, 1, reflector_ptr);
        zend_declare_property_string(reflection_zend_extension_ptr, "name", sizeof("name")-1, "", ZEND_ACC_PUBLIC TSRMLS_CC);
 
        return SUCCESS;
index 508530a5478fb008d6c2e333477d3d1c664a7cdd..8dd571c3a9cc2386288504d19bcf9668e5e49392 100644 (file)
@@ -21,7 +21,7 @@ Class [ <internal:Reflection> class ReflectionClass implements Reflector ] {
   }
 
   - Static methods [1] {
-    Method [ <internal:Reflection> static public method export ] {
+    Method [ <internal:Reflection, prototype Reflector> static public method export ] {
 
       - Parameters [2] {
         Parameter #0 [ <required> $argument ]
@@ -48,7 +48,7 @@ Class [ <internal:Reflection> class ReflectionClass implements Reflector ] {
       }
     }
 
-    Method [ <internal:Reflection> public method __toString ] {
+    Method [ <internal:Reflection, prototype Reflector> public method __toString ] {
 
       - Parameters [0] {
       }