Problem/Motivation

Drupal 7 on PHP 8.1 emits deprecation notices due to signature mismatches with the PHP built-in ArrayAccess class and Drupal's DrupalCacheArray class.

Steps to reproduce

Run Drupal 7 on PHP 8.1

Proposed resolution

Add #[ReturnTypeWillChange] attribute to all mismatching method declarations in the DrupalCacheArray class.

Remaining tasks

Add #[ReturnTypeWillChange] attribute to all mismatching method declarations in the DrupalCacheArray class.

User interface changes

None.

API changes

None.

Data model changes

None.

Release notes snippet

N/A

Details:
- RFC
- PHP 8.1: Return types in PHP built-in class methods and deprecation notices
- PHP 8.1: New #[ReturnTypeWillChange] attribute

Issue fork drupal-3241412

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Ayesh created an issue. See original summary.

mcdruid made their first commit to this issue’s fork.

mcdruid’s picture

Status: Active » Needs review

  • mcdruid committed 63bafeb on 7.x
    Issue #3241412 by Ayesh: [PHP 8.1] DrupalCacheArray deprecation notices...
mcdruid’s picture

Status: Needs review » Fixed

Thanks @Ayesh!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.