Skip to content

Commit

Permalink
phpdbg: Call enums “Enum” and traits “Trait” in info classes (#17191)
Browse files Browse the repository at this point in the history
* phpdbg: Call enums “Enum” in `info classes`

* phpdbg: Call traits “Trait” in `info classes`
  • Loading branch information
TimWolla authored Dec 17, 2024
1 parent 97f44b7 commit 3fea646
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion sapi/phpdbg/phpdbg_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
} /* }}} */
Expand Down

0 comments on commit 3fea646

Please sign in to comment.