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,
2151
+
* because only they must be declared in the same class. */
2152
+
if (!is_explicit_abstract|| (func->common.fn_flags&ZEND_ACC_PRIVATE)) {
2153
+
zend_verify_abstract_class_function(func, &ai);
2154
+
}
2155
+
}
2153
2156
} ZEND_HASH_FOREACH_END();
2154
2157
2155
2158
if (ai.cnt) {
2156
-
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")"
2161
+
: "Class %s must implement %d abstract private method%s ("MAX_ABSTRACT_INFO_FMTMAX_ABSTRACT_INFO_FMTMAX_ABSTRACT_INFO_FMT")",
2157
2162
ZSTR_VAL(ce->name), ai.cnt,
2158
2163
ai.cnt>1 ? "s" : "",
2159
2164
DISPLAY_ABSTRACT_FN(0),
@@ -2432,7 +2437,9 @@ ZEND_API int zend_do_link_class(zend_class_entry *ce, zend_string *lc_parent_nam
2432
2437
if (interfaces) {
2433
2438
zend_do_implement_interfaces(ce, interfaces);
2434
2439
}
2435
-
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) {
2440
+
if (!(ce->ce_flags& (ZEND_ACC_INTERFACE|ZEND_ACC_TRAIT))
0 commit comments