From 82ebaa6591dd79d7c68d67d939584bb6dab27d71 Mon Sep 17 00:00:00 2001
From: jrfnl <jrfnl@users.noreply.github.com>
Date: Fri, 23 Jul 2021 03:12:46 +0200
Subject: [PATCH 2/2] PHP 8.1: WP_Theme: silence return type missing
deprecation warning
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
PHP native interfaces now have declared return types and methods in classes implementing these interfaces need to either have the return type declared (in a covariant compatible manner with the PHP native interface method declaration) òr need to silence the deprecation warning using an attribute.
---
src/wp-includes/class-wp-theme.php | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/wp-includes/class-wp-theme.php b/src/wp-includes/class-wp-theme.php
index a3c996e59f..d0607528b5 100644
|
a
|
b
|
final class WP_Theme implements ArrayAccess {
|
| 556 | 556 | * @param mixed $offset |
| 557 | 557 | * @param mixed $value |
| 558 | 558 | */ |
| | 559 | #[ReturnTypeWillChange] |
| 559 | 560 | public function offsetSet( $offset, $value ) {} |
| 560 | 561 | |
| 561 | 562 | /** |
| … |
… |
final class WP_Theme implements ArrayAccess {
|
| 565 | 566 | * |
| 566 | 567 | * @param mixed $offset |
| 567 | 568 | */ |
| | 569 | #[ReturnTypeWillChange] |
| 568 | 570 | public function offsetUnset( $offset ) {} |
| 569 | 571 | |
| 570 | 572 | /** |
| … |
… |
final class WP_Theme implements ArrayAccess {
|
| 575 | 577 | * @param mixed $offset |
| 576 | 578 | * @return bool |
| 577 | 579 | */ |
| | 580 | #[ReturnTypeWillChange] |
| 578 | 581 | public function offsetExists( $offset ) { |
| 579 | 582 | static $keys = array( |
| 580 | 583 | 'Name', |
| … |
… |
final class WP_Theme implements ArrayAccess {
|
| 616 | 619 | * @param mixed $offset |
| 617 | 620 | * @return mixed |
| 618 | 621 | */ |
| | 622 | #[ReturnTypeWillChange] |
| 619 | 623 | public function offsetGet( $offset ) { |
| 620 | 624 | switch ( $offset ) { |
| 621 | 625 | case 'Name': |