mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Don't directly throw warning during method compatibility check
Only return the INHERITANCE_WARNING status.
This commit is contained in:
parent
9939b2b71f
commit
3b7edb6587
1 changed files with 5 additions and 6 deletions
|
@ -668,14 +668,13 @@ static inheritance_status zend_do_perform_implementation_check(
|
|||
if (proto->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) {
|
||||
/* Removing a return type is not valid, unless the parent return type is tentative. */
|
||||
if (!(fe->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE)) {
|
||||
if (ZEND_ARG_TYPE_IS_TENTATIVE(&proto->common.arg_info[-1])) {
|
||||
if (status == INHERITANCE_SUCCESS) {
|
||||
emit_incompatible_method_error(fe, fe_scope, proto, proto_scope, INHERITANCE_WARNING);
|
||||
}
|
||||
return status;
|
||||
} else {
|
||||
if (!ZEND_ARG_TYPE_IS_TENTATIVE(&proto->common.arg_info[-1])) {
|
||||
return INHERITANCE_ERROR;
|
||||
}
|
||||
if (status == INHERITANCE_SUCCESS) {
|
||||
return INHERITANCE_WARNING;
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
||||
local_status = zend_perform_covariant_type_check(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue