You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make sure that abstract private is implemented in same class
Normally it's enough to mark the class as "abstract" if an abstract
method was not implemented. However, if there are abstract private
methods, then even they really must be implemented, or it must
be forwarded to a method with higher visibility.
/* If the class is explicitly abstract, we only check private abstract methods,
2157
+
* because only they must be declared in the same class. */
2158
+
if (!is_explicit_abstract|| (func->common.fn_flags&ZEND_ACC_PRIVATE)) {
2159
+
zend_verify_abstract_class_function(func, &ai);
2160
+
}
2161
+
}
2159
2162
} ZEND_HASH_FOREACH_END();
2160
2163
2161
2164
if (ai.cnt) {
2162
-
zend_error_noreturn(E_ERROR, "Class %s contains %d abstract method%s and must therefore be declared abstract or implement the remaining methods ("MAX_ABSTRACT_INFO_FMTMAX_ABSTRACT_INFO_FMTMAX_ABSTRACT_INFO_FMT")",
? "Class %s contains %d abstract method%s and must therefore be declared abstract or implement the remaining methods ("MAX_ABSTRACT_INFO_FMTMAX_ABSTRACT_INFO_FMTMAX_ABSTRACT_INFO_FMT")"
2167
+
: "Class %s must implement %d abstract private method%s ("MAX_ABSTRACT_INFO_FMTMAX_ABSTRACT_INFO_FMTMAX_ABSTRACT_INFO_FMT")",
2163
2168
ZSTR_VAL(ce->name), ai.cnt,
2164
2169
ai.cnt>1 ? "s" : "",
2165
2170
DISPLAY_ABSTRACT_FN(0),
@@ -2438,7 +2443,9 @@ ZEND_API int zend_do_link_class(zend_class_entry *ce, zend_string *lc_parent_nam
2438
2443
if (interfaces) {
2439
2444
zend_do_implement_interfaces(ce, interfaces);
2440
2445
}
2441
-
if ((ce->ce_flags& (ZEND_ACC_IMPLICIT_ABSTRACT_CLASS|ZEND_ACC_INTERFACE|ZEND_ACC_TRAIT|ZEND_ACC_EXPLICIT_ABSTRACT_CLASS)) ==ZEND_ACC_IMPLICIT_ABSTRACT_CLASS) {
2446
+
if (!(ce->ce_flags& (ZEND_ACC_INTERFACE|ZEND_ACC_TRAIT))
0 commit comments