com php-src: Removed weird test, trait can't be "static" or "final".: Zend/zend_inheritance.c
| From: | Dmitry Stogov | Date: | Tue, 11 Sep 2018 14:07:06 +0000 |
| Subject: | com php-src: Removed weird test, trait can't be "static" or "final".: Zend/zend_inheritance.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-103066@lists.php.net to get a copy of this message | ||
Commit: 1570fe180f34f957ad55e912133cd34ac99087d5
Author: Dmitry Stogov <dmitry@zend.com> Tue, 11 Sep 2018 17:07:06 +0300
Parents: e1123e3e4ea3f41062c4ac47bb5a33aac77a837e
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=1570fe180f34f957ad55e912133cd34ac99087d5
Log:
Removed weird test, trait can't be "static" or "final".
Changed paths:
M Zend/zend_inheritance.c
Diff:
diff --git a/Zend/zend_inheritance.c b/Zend/zend_inheritance.c
index eef6c5b..d97fe45 100644
--- a/Zend/zend_inheritance.c
+++ b/Zend/zend_inheritance.c
@@ -1170,17 +1170,6 @@ static void zend_do_implement_interfaces(zend_class_entry *ce) /* {{{ */
}
/* }}} */
-static zend_bool zend_traits_method_compatibility_check(zend_function *fn, zend_function *other_fn)
/* {{{ */
-{
- uint32_t fn_flags = fn->common.scope->ce_flags;
- uint32_t other_flags = other_fn->common.scope->ce_flags;
-
- return zend_do_perform_implementation_check(fn, other_fn)
- && ((fn_flags & (ZEND_ACC_FINAL|ZEND_ACC_STATIC)) ==
- (other_flags & (ZEND_ACC_FINAL|ZEND_ACC_STATIC))); /* equal final and static qualifier */
-}
-/* }}} */
-
static void zend_add_magic_methods(zend_class_entry* ce, zend_string* mname, zend_function* fe) /*
{{{ */
{
if (ZSTR_LEN(ce->name) == ZSTR_LEN(mname)) {
@@ -1249,7 +1238,7 @@ static void zend_add_trait_method(zend_class_entry *ce, const char *name,
zend_s
if ((existing_fn = zend_hash_find_ptr(*overridden, key)) != NULL) {
if (existing_fn->common.fn_flags & ZEND_ACC_ABSTRACT) {
/* Make sure the trait method is compatible with previosly declared abstract method */
- if (UNEXPECTED(!zend_traits_method_compatibility_check(fn, existing_fn))) {
+ if (UNEXPECTED(!zend_do_perform_implementation_check(fn, existing_fn))) {
zend_error_noreturn(E_COMPILE_ERROR, "Declaration of %s must be compatible with
%s",
ZSTR_VAL(zend_get_function_declaration(fn)),
ZSTR_VAL(zend_get_function_declaration(existing_fn)));
@@ -1257,7 +1246,7 @@ static void zend_add_trait_method(zend_class_entry *ce, const char *name,
zend_s
}
if (fn->common.fn_flags & ZEND_ACC_ABSTRACT) {
/* Make sure the abstract declaration is compatible with previous declaration */
- if (UNEXPECTED(!zend_traits_method_compatibility_check(existing_fn, fn))) {
+ if (UNEXPECTED(!zend_do_perform_implementation_check(existing_fn, fn))) {
zend_error_noreturn(E_COMPILE_ERROR, "Declaration of %s must be compatible with
%s",
ZSTR_VAL(zend_get_function_declaration(existing_fn)),
ZSTR_VAL(zend_get_function_declaration(fn)));
@@ -1274,14 +1263,14 @@ static void zend_add_trait_method(zend_class_entry *ce, const char *name,
zend_s
} else if (existing_fn->common.fn_flags & ZEND_ACC_ABSTRACT &&
(existing_fn->common.scope->ce_flags & ZEND_ACC_INTERFACE) == 0) {
/* Make sure the trait method is compatible with previosly declared abstract method */
- if (UNEXPECTED(!zend_traits_method_compatibility_check(fn, existing_fn))) {
+ if (UNEXPECTED(!zend_do_perform_implementation_check(fn, existing_fn))) {
zend_error_noreturn(E_COMPILE_ERROR, "Declaration of %s must be compatible with %s",
ZSTR_VAL(zend_get_function_declaration(fn)),
ZSTR_VAL(zend_get_function_declaration(existing_fn)));
}
} else if (fn->common.fn_flags & ZEND_ACC_ABSTRACT) {
/* Make sure the abstract declaration is compatible with previous declaration */
- if (UNEXPECTED(!zend_traits_method_compatibility_check(existing_fn, fn))) {
+ if (UNEXPECTED(!zend_do_perform_implementation_check(existing_fn, fn))) {
zend_error_noreturn(E_COMPILE_ERROR, "Declaration of %s must be compatible with %s",
ZSTR_VAL(zend_get_function_declaration(existing_fn)),
ZSTR_VAL(zend_get_function_declaration(fn)));