2020 * @package WordPress
2121 * @since 3.6.0
2222 */
23-
2423class Recursive_ArrayAccess implements ArrayAccess {
2524 /**
2625 * Internal data collection.
@@ -62,8 +61,7 @@ public function __clone() {
6261 *
6362 * @return array
6463 */
65- #[\ReturnTypeWillChange]
66- public function toArray () {
64+ public function toArray () : array {
6765 $ data = $ this ->container ;
6866 foreach ( $ data as $ key => $ value ) {
6967 if ( $ value instanceof self ) {
@@ -85,8 +83,7 @@ public function toArray() {
8583 *
8684 * @return boolean true on success or false on failure.
8785 */
88- #[\ReturnTypeWillChange]
89- public function offsetExists ( $ offset ) {
86+ public function offsetExists ( $ offset ) : bool {
9087 return isset ( $ this ->container [ $ offset ] );
9188 }
9289
@@ -99,8 +96,7 @@ public function offsetExists( $offset ) {
9996 *
10097 * @return mixed Can return all value types.
10198 */
102- #[\ReturnTypeWillChange]
103- public function offsetGet ( $ offset ) {
99+ public function offsetGet ( $ offset ) : mixed {
104100 return isset ( $ this ->container [ $ offset ] ) ? $ this ->container [ $ offset ] : null ;
105101 }
106102
@@ -114,8 +110,7 @@ public function offsetGet( $offset ) {
114110 *
115111 * @return void
116112 */
117- #[\ReturnTypeWillChange]
118- public function offsetSet ( $ offset , $ data ) {
113+ public function offsetSet ( $ offset , $ data ) : void {
119114 if ( is_array ( $ data ) ) {
120115 $ data = new self ( $ data );
121116 }
@@ -136,8 +131,7 @@ public function offsetSet( $offset, $data ) {
136131 *
137132 * @return void
138133 */
139- #[\ReturnTypeWillChange]
140- public function offsetUnset ( $ offset ) {
134+ public function offsetUnset ( $ offset ) : void {
141135 unset( $ this ->container [ $ offset ] );
142136 }
143137}
0 commit comments