Skip to content

Commit 7684891

Browse files
author
Chris Gårdenberg
committed
fix: #[\ReturnTypeWillChange] instead of typing, because PHP is.. well PHP
1 parent 5be39c6 commit 7684891

2 files changed

Lines changed: 12 additions & 6 deletions

File tree

PLUGIN-CHECKSUM

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
c91a37314adf8c17951e723810b306ca
1+
57a777e2345aaef14fc04c023bbddcd1

libraries/class-recursive-arrayaccess.php

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
* @package WordPress
2121
* @since 3.6.0
2222
*/
23+
2324
class Recursive_ArrayAccess implements ArrayAccess {
2425
/**
2526
* Internal data collection.
@@ -61,7 +62,8 @@ public function __clone() {
6162
*
6263
* @return array
6364
*/
64-
public function toArray() : array {
65+
#[\ReturnTypeWillChange]
66+
public function toArray() {
6567
$data = $this->container;
6668
foreach ( $data as $key => $value ) {
6769
if ( $value instanceof self ) {
@@ -83,7 +85,8 @@ public function toArray() : array {
8385
*
8486
* @return boolean true on success or false on failure.
8587
*/
86-
public function offsetExists( $offset ) : bool {
88+
#[\ReturnTypeWillChange]
89+
public function offsetExists( $offset ) {
8790
return isset( $this->container[ $offset ] );
8891
}
8992

@@ -96,7 +99,8 @@ public function offsetExists( $offset ) : bool {
9699
*
97100
* @return mixed Can return all value types.
98101
*/
99-
public function offsetGet( $offset ) : mixed {
102+
#[\ReturnTypeWillChange]
103+
public function offsetGet( $offset ) {
100104
return isset( $this->container[ $offset ] ) ? $this->container[ $offset ] : null;
101105
}
102106

@@ -110,7 +114,8 @@ public function offsetGet( $offset ) : mixed {
110114
*
111115
* @return void
112116
*/
113-
public function offsetSet( $offset, $data ) : void {
117+
#[\ReturnTypeWillChange]
118+
public function offsetSet( $offset, $data ) {
114119
if ( is_array( $data ) ) {
115120
$data = new self( $data );
116121
}
@@ -131,7 +136,8 @@ public function offsetSet( $offset, $data ) : void {
131136
*
132137
* @return void
133138
*/
134-
public function offsetUnset( $offset ) : void {
139+
#[\ReturnTypeWillChange]
140+
public function offsetUnset( $offset ) {
135141
unset( $this->container[ $offset ] );
136142
}
137143
}

0 commit comments

Comments
 (0)