com php-src: refactor switch: Zend/zend_API.c

From: Date: Wed, 09 Mar 2016 13:19:18 +0000
Subject: com php-src: refactor switch: Zend/zend_API.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-95699@lists.php.net to get a copy of this message
Commit: fa835f34936c4bfae2891b50d94a86a44f9122a5 Author: Joe Watkins <krakjoe@php.net> Wed, 9 Mar 2016 13:19:18 +0000 Parents: d2ab6d2aa0d54b7161067213554ae77fd488d76b Branches: typed_ref_properties Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=fa835f34936c4bfae2891b50d94a86a44f9122a5 Log: refactor switch Changed paths: M Zend/zend_API.c Diff: diff --git a/Zend/zend_API.c b/Zend/zend_API.c index 6fa31e1..5dea8f1 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -3623,19 +3623,20 @@ ZEND_API int zend_declare_typed_property(zend_class_entry *ce, zend_string *name } if (optional_type) { - if (Z_TYPE_P(property) != IS_UNDEF) { - zend_string *type_name = optional_type_name; + switch (Z_TYPE_P(property)) { + case IS_UNDEF: + case IS_CONSTANT: + case IS_CONSTANT_AST: + break; - if (type_name && zend_string_equals_literal_ci(type_name, "self")) { - type_name = ce->name; - } + default: { + zend_string *type_name = optional_type_name; - switch (Z_TYPE_P(property)) { - case IS_CONSTANT: - case IS_CONSTANT_AST: - break; + if (type_name && zend_string_equals_literal_ci(type_name, "self")) { + type_name = ce->name; + } - default: if (!zend_verify_property_type(ce, name, optional_type, type_name, NULL, property, 0)) { + if (!zend_verify_property_type(ce, name, optional_type, type_name, NULL, property, 0)) { return FAILURE; } }

« previous php.cvs (#95699) next »