PHP8.1 compatibility problems: not covariant return type

Created on 28 April 2023, over 1 year ago

Problem/Motivation

Phpstan tool found some deprecation issues, that are not ok for php8.1. All of the same kind: "the return type of method is not covariant with tentative return type of parent method". Php8.1 requires declaration of return type otherwise you will get the deprecation notice.

Problems are located in these files:
- modules/contrib/language_hierarchy/includes/LocaleContextHierarchy.class.inc
- modules/contrib/language_hierarchy/includes/LocaleHierarchy.class.inc

Proposed resolution

Use the #[\ReturnTypeWillChange] attribute to temporarily suppress the error.

🐛 Bug report
Status

Closed: duplicate

Version

1.4

Component

Code

Created by

Live updates comments and jobs are added and updated live.
  • PHP 8.1

    The issue particularly affects sites running on PHP version 8.1.0 or later.

Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024