summaryrefslogtreecommitdiff
path: root/ext/reflection
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2018-10-04 10:56:43 +0200
committerNikita Popov <nikita.ppv@gmail.com>2018-10-04 12:46:50 +0200
commitf48ee1ff58da5cb2aadf617b6f0c34cd2a7a973c (patch)
treee2bb7ee855a67a5760482c88ed8074a766c7001d /ext/reflection
parent74d138e4a3c0cb408112d23b88ccb0e4a8571c48 (diff)
downloadphp-git-f48ee1ff58da5cb2aadf617b6f0c34cd2a7a973c.tar.gz
Clarify that the get_properties handler is required
Some places were checking for non-null get_properties, some weren't. Make it clear that the handler is required and such checks are not necessary.
Diffstat (limited to 'ext/reflection')
-rw-r--r--ext/reflection/php_reflection.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c
index 4838b5cebc..8114625e68 100644
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@ -434,7 +434,7 @@ static void _class_string(smart_str *str, zend_class_entry *ce, zval *obj, char
}
smart_str_append_printf(str, "%s }\n", indent);
- if (obj && Z_TYPE_P(obj) == IS_OBJECT && Z_OBJ_HT_P(obj)->get_properties) {
+ if (obj && Z_TYPE_P(obj) == IS_OBJECT) {
HashTable *properties = Z_OBJ_HT_P(obj)->get_properties(obj);
zend_string *prop_name;
smart_str prop_str = {0};
@@ -4322,7 +4322,7 @@ ZEND_METHOD(reflection_class, getProperties)
_addproperty(prop_info, key, ce, return_value, filter);
} ZEND_HASH_FOREACH_END();
- if (Z_TYPE(intern->obj) != IS_UNDEF && (filter & ZEND_ACC_PUBLIC) != 0 && Z_OBJ_HT(intern->obj)->get_properties) {
+ if (Z_TYPE(intern->obj) != IS_UNDEF && (filter & ZEND_ACC_PUBLIC) != 0) {
HashTable *properties = Z_OBJ_HT(intern->obj)->get_properties(&intern->obj);
zval *prop;
ZEND_HASH_FOREACH_STR_KEY_VAL(properties, key, prop) {
@@ -5227,7 +5227,7 @@ ZEND_METHOD(reflection_property, __construct)
|| ((property_info->flags & ZEND_ACC_PRIVATE)
&& property_info->ce != ce)) {
/* Check for dynamic properties */
- if (property_info == NULL && Z_TYPE_P(classname) == IS_OBJECT && Z_OBJ_HT_P(classname)->get_properties) {
+ if (property_info == NULL && Z_TYPE_P(classname) == IS_OBJECT) {
if (zend_hash_exists(Z_OBJ_HT_P(classname)->get_properties(classname), name)) {
dynam_prop = 1;
}