summaryrefslogtreecommitdiff
path: root/ext/reflection/php_reflection.c
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2018-02-04 23:20:14 +0100
committerNikita Popov <nikita.ppv@gmail.com>2018-02-04 23:20:44 +0100
commitb4dff68379d8625f4895e74841683205d3fdd9ae (patch)
tree6badf7a937481750c167400cf02e0496b968c442 /ext/reflection/php_reflection.c
parentfef879a2d63899ed25f39b4581c16682afdd0a8f (diff)
downloadphp-git-b4dff68379d8625f4895e74841683205d3fdd9ae.tar.gz
Remove no longer necessary type-name special cases
zend_get_type_by_name() now produces the correct value by itself, so we no longer need these workarounds.
Diffstat (limited to 'ext/reflection/php_reflection.c')
-rw-r--r--ext/reflection/php_reflection.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c
index 6749003c46..ee456d05f0 100644
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@ -2914,17 +2914,9 @@ ZEND_METHOD(reflection_type, isBuiltin)
static zend_string *reflection_type_name(type_reference *param) {
if (ZEND_TYPE_IS_CLASS(param->arg_info->type)) {
return zend_string_copy(ZEND_TYPE_NAME(param->arg_info->type));
- }
- switch (ZEND_TYPE_CODE(param->arg_info->type)) {
- /* keep this for BC, bool vs boolean, int vs integer */
- case _IS_BOOL: return zend_string_init("bool", sizeof("bool") - 1, 0);
- case IS_LONG: return zend_string_init("int", sizeof("int") - 1, 0);
- /* use zend API for other types */
- default:
- {
- char *name = zend_get_type_by_const(ZEND_TYPE_CODE(param->arg_info->type));
- return zend_string_init(name, strlen(name), 0);
- }
+ } else {
+ char *name = zend_get_type_by_const(ZEND_TYPE_CODE(param->arg_info->type));
+ return zend_string_init(name, strlen(name), 0);
}
}
/* }}} */