phpdbg: Call enums “Enum” and traits “Trait” in info classes (#17191)

* phpdbg: Call enums “Enum” in `info classes`

* phpdbg: Call traits “Trait” in `info classes`
This commit is contained in:
Tim Düsterhus 2024-12-17 19:32:47 +01:00 committed by GitHub
parent 97f44b7c39
commit 3fea6468fe
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -374,7 +374,11 @@ PHPDBG_INFO(memory) /* {{{ */
static inline void phpdbg_print_class_name(zend_class_entry *ce) /* {{{ */
{
const char *visibility = ce->type == ZEND_USER_CLASS ? "User" : "Internal";
const char *type = (ce->ce_flags & ZEND_ACC_INTERFACE) ? "Interface" : (ce->ce_flags & ZEND_ACC_ABSTRACT) ? "Abstract Class" : "Class";
const char *type = (ce->ce_flags & ZEND_ACC_INTERFACE) ? "Interface"
: (ce->ce_flags & ZEND_ACC_ABSTRACT) ? "Abstract Class"
: (ce->ce_flags & ZEND_ACC_ENUM) ? "Enum"
: (ce->ce_flags & ZEND_ACC_TRAIT) ? "Trait"
: "Class";
phpdbg_writeln("%s %s %.*s (%d)", visibility, type, (int) ZSTR_LEN(ce->name), ZSTR_VAL(ce->name), zend_hash_num_elements(&ce->function_table));
} /* }}} */