@@ -1767,17 +1767,9 @@ ZEND_METHOD(ReflectionFunctionAbstract, getAttributes)
1767
1767
reflection_object * intern ;
1768
1768
zend_function * fptr ;
1769
1769
1770
- HashTable * attributes = NULL ;
1771
- zend_class_entry * scope = NULL ;
1772
-
1773
1770
GET_REFLECTION_OBJECT_PTR (fptr );
1774
1771
1775
- if (fptr -> type == ZEND_USER_FUNCTION && fptr -> op_array .attributes ) {
1776
- attributes = fptr -> op_array .attributes ;
1777
- scope = fptr -> common .scope ;
1778
- }
1779
-
1780
- reflect_attributes (INTERNAL_FUNCTION_PARAM_PASSTHRU , attributes , 0 , scope );
1772
+ reflect_attributes (INTERNAL_FUNCTION_PARAM_PASSTHRU , fptr -> common .attributes , 0 , fptr -> common .scope );
1781
1773
}
1782
1774
/* }}} */
1783
1775
@@ -2714,15 +2706,10 @@ ZEND_METHOD(ReflectionParameter, getAttributes)
2714
2706
reflection_object * intern ;
2715
2707
parameter_reference * param ;
2716
2708
2717
- HashTable * attributes = NULL ;
2718
- zend_class_entry * scope = NULL ;
2719
-
2720
2709
GET_REFLECTION_OBJECT_PTR (param );
2721
2710
2722
- if (param -> fptr -> type == ZEND_USER_FUNCTION && param -> fptr -> op_array .attributes ) {
2723
- attributes = param -> fptr -> op_array .attributes ;
2724
- scope = param -> fptr -> common .scope ;
2725
- }
2711
+ HashTable * attributes = param -> fptr -> common .attributes ;
2712
+ zend_class_entry * scope = param -> fptr -> common .scope ;
2726
2713
2727
2714
reflect_attributes (INTERNAL_FUNCTION_PARAM_PASSTHRU , attributes , param -> offset + 1 , scope );
2728
2715
}
@@ -3790,17 +3777,9 @@ ZEND_METHOD(ReflectionClassConstant, getAttributes)
3790
3777
reflection_object * intern ;
3791
3778
zend_class_constant * ref ;
3792
3779
3793
- HashTable * attributes = NULL ;
3794
- zend_class_entry * scope = NULL ;
3795
-
3796
3780
GET_REFLECTION_OBJECT_PTR (ref );
3797
3781
3798
- if (ref -> attributes ) {
3799
- attributes = ref -> attributes ;
3800
- scope = ref -> ce ;
3801
- }
3802
-
3803
- reflect_attributes (INTERNAL_FUNCTION_PARAM_PASSTHRU , attributes , 0 , scope );
3782
+ reflect_attributes (INTERNAL_FUNCTION_PARAM_PASSTHRU , ref -> attributes , 0 , ref -> ce );
3804
3783
}
3805
3784
/* }}} */
3806
3785
@@ -5691,17 +5670,9 @@ ZEND_METHOD(ReflectionProperty, getAttributes)
5691
5670
reflection_object * intern ;
5692
5671
property_reference * ref ;
5693
5672
5694
- HashTable * attributes = NULL ;
5695
- zend_class_entry * scope = NULL ;
5696
-
5697
5673
GET_REFLECTION_OBJECT_PTR (ref );
5698
5674
5699
- if (ref -> prop -> attributes ) {
5700
- attributes = ref -> prop -> attributes ;
5701
- scope = ref -> prop -> ce ;
5702
- }
5703
-
5704
- reflect_attributes (INTERNAL_FUNCTION_PARAM_PASSTHRU , attributes , 0 , scope );
5675
+ reflect_attributes (INTERNAL_FUNCTION_PARAM_PASSTHRU , ref -> prop -> attributes , 0 , ref -> prop -> ce );
5705
5676
}
5706
5677
/* }}} */
5707
5678
0 commit comments