PHP 8.1 compatibility - phpstan notices

Created on 13 April 2023, over 1 year ago
Updated 15 August 2023, over 1 year ago

Problem/Motivation

The following deprecated notices occurs in PHP 8.1:

 
 22     Return type mixed of method LocaleContextHierarchy::offsetGet() is not covariant with tentative return type mixed of method ArrayAccess::offsetGet().       
         💡 Make it covariant, or use the #[\ReturnTypeWillChange] attribute to temporarily suppress the error.                                                      
  42     Return type mixed of method LocaleContextHierarchy::offsetExists() is not covariant with tentative return type bool of method ArrayAccess::offsetExists().  
         💡 Make it covariant, or use the #[\ReturnTypeWillChange] attribute to temporarily suppress the error.                                                      
  46     Return type mixed of method LocaleContextHierarchy::offsetSet() is not covariant with tentative return type void of method ArrayAccess::offsetSet().        
         💡 Make it covariant, or use the #[\ReturnTypeWillChange] attribute to temporarily suppress the error.                                                      
  47     Return type mixed of method LocaleContextHierarchy::offsetUnset() is not covariant with tentative return type void of method ArrayAccess::offsetUnset().    
         💡 Make it covariant, or use the #[\ReturnTypeWillChange] attribute to temporarily suppress the error.                

files :
modules/contrib/language_hierarchy/includes/LocaleContextHierarchy.class.inc
modules/contrib/language_hierarchy/includes/LocaleHierarchy.class.inc

Proposed resolution

Type hinting addition

📌 Task
Status

Needs review

Version

1.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024