Skip to content

Commit

Permalink
Revert r322390.
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Jan 17, 2012
1 parent e76c1cc commit ebddf8a
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 130 deletions.
5 changes: 0 additions & 5 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,4 @@ PHP NEWS
- pgsql
. Added pg_escape_literal() and pg_escape_identifier() (Yasuo)

- Reflection:
. Added ReflectionCLass::setFinal() and ReflectionMethod::setFinal() to allow
stubbing and mocking of final classes and methods, for instance.
(Sebastian, Jan Dolecek <[email protected]>)

<<< NOTE: Insert NEWS from last stable release here prior to actual release! >>>
54 changes: 0 additions & 54 deletions ext/reflection/php_reflection.c
Original file line number Diff line number Diff line change
Expand Up @@ -3113,28 +3113,6 @@ ZEND_METHOD(reflection_method, getModifiers)
}
/* }}} */

/* {{{ proto public void ReflectionMethod::setFinal([bool isFinal = true])
Sets/unsets class as final */
ZEND_METHOD(reflection_method, setFinal)
{
reflection_object *intern;
zend_function *mptr;
zend_bool isFinal = 1;

if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &isFinal) == FAILURE) {
return;
}

GET_REFLECTION_OBJECT_PTR(mptr);

if (isFinal) {
mptr->common.fn_flags |= ZEND_ACC_FINAL;
} else {
mptr->common.fn_flags &= ~ZEND_ACC_FINAL;
}
}
/* }}} */

/* {{{ proto public ReflectionClass ReflectionMethod::getDeclaringClass()
Get the declaring class */
ZEND_METHOD(reflection_method, getDeclaringClass)
Expand Down Expand Up @@ -4069,28 +4047,6 @@ ZEND_METHOD(reflection_class, isAbstract)
}
/* }}} */

/* {{{ proto public void ReflectionClass::setFinal([bool isFinal = true])
Sets/unsets class as final */
ZEND_METHOD(reflection_class, setFinal)
{
reflection_object *intern;
zend_class_entry *ce;
zend_bool isFinal = 1;

if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|b", &isFinal) == FAILURE) {
return;
}

GET_REFLECTION_OBJECT_PTR(ce);

if (isFinal) {
ce->ce_flags |= ZEND_ACC_FINAL_CLASS;
} else {
ce->ce_flags &= ~ZEND_ACC_FINAL_CLASS;
}
}
/* }}} */

/* {{{ proto public int ReflectionClass::getModifiers()
Returns a bitfield of the access modifiers for this class */
ZEND_METHOD(reflection_class, getModifiers)
Expand Down Expand Up @@ -5695,10 +5651,6 @@ ZEND_BEGIN_ARG_INFO(arginfo_reflection_method_setAccessible, 0)
ZEND_ARG_INFO(0, value)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO(arginfo_reflection_method_setFinal, 0)
ZEND_ARG_INFO(0, value)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO(arginfo_reflection_method_getClosure, 0)
ZEND_ARG_INFO(0, object)
ZEND_END_ARG_INFO()
Expand All @@ -5712,7 +5664,6 @@ static const zend_function_entry reflection_method_functions[] = {
ZEND_ME(reflection_method, isProtected, arginfo_reflection__void, 0)
ZEND_ME(reflection_method, isAbstract, arginfo_reflection__void, 0)
ZEND_ME(reflection_method, isFinal, arginfo_reflection__void, 0)
ZEND_ME(reflection_method, setFinal, arginfo_reflection_method_setFinal, 0)
ZEND_ME(reflection_method, isStatic, arginfo_reflection__void, 0)
ZEND_ME(reflection_method, isConstructor, arginfo_reflection__void, 0)
ZEND_ME(reflection_method, isDestructor, arginfo_reflection__void, 0)
Expand Down Expand Up @@ -5782,10 +5733,6 @@ ZEND_BEGIN_ARG_INFO(arginfo_reflection_class_isInstance, 0)
ZEND_ARG_INFO(0, object)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO(arginfo_reflection_class_setFinal, 0)
ZEND_ARG_INFO(0, value)
ZEND_END_ARG_INFO()

ZEND_BEGIN_ARG_INFO(arginfo_reflection_class_newInstance, 0)
ZEND_ARG_INFO(0, args)
ZEND_END_ARG_INFO()
Expand Down Expand Up @@ -5838,7 +5785,6 @@ static const zend_function_entry reflection_class_functions[] = {
ZEND_ME(reflection_class, isTrait, arginfo_reflection__void, 0)
ZEND_ME(reflection_class, isAbstract, arginfo_reflection__void, 0)
ZEND_ME(reflection_class, isFinal, arginfo_reflection__void, 0)
ZEND_ME(reflection_class, setFinal, arginfo_reflection_class_setFinal, 0)
ZEND_ME(reflection_class, getModifiers, arginfo_reflection__void, 0)
ZEND_ME(reflection_class, isInstance, arginfo_reflection_class_isInstance, 0)
ZEND_ME(reflection_class, newInstance, arginfo_reflection_class_newInstance, 0)
Expand Down
33 changes: 0 additions & 33 deletions ext/reflection/tests/ReflectionClass_setFinal.phpt

This file was deleted.

11 changes: 2 additions & 9 deletions ext/reflection/tests/ReflectionClass_toString_001.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Steve Seear <[email protected]>
$rc = new ReflectionClass("ReflectionClass");
echo $rc;
?>
--EXPECT--
--EXPECTF--
Class [ <internal:Reflection> class ReflectionClass implements Reflector ] {

- Constants [3] {
Expand All @@ -34,7 +34,7 @@ Class [ <internal:Reflection> class ReflectionClass implements Reflector ] {
Property [ <default> public $name ]
}

- Methods [50] {
- Methods [49] {
Method [ <internal:Reflection> final private method __clone ] {

- Parameters [0] {
Expand Down Expand Up @@ -230,13 +230,6 @@ Class [ <internal:Reflection> class ReflectionClass implements Reflector ] {
}
}

Method [ <internal:Reflection> public method setFinal ] {

- Parameters [1] {
Parameter #0 [ <required> $value ]
}
}

Method [ <internal:Reflection> public method getModifiers ] {

- Parameters [0] {
Expand Down
29 changes: 0 additions & 29 deletions ext/reflection/tests/ReflectionMethod_setFinal.phpt

This file was deleted.

0 comments on commit ebddf8a

Please sign in to comment.