From 575cc70169441ce76ddd9c8c9e0ea3584fe72723 Mon Sep 17 00:00:00 2001 From: Arafat Zahan Date: Tue, 1 Nov 2022 18:41:37 +0600 Subject: [PATCH] Add `ReturnTypeWillChange` attribute to supress warnings. --- includes/Core/REST_API/Data_Request.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/includes/Core/REST_API/Data_Request.php b/includes/Core/REST_API/Data_Request.php index 4e8746a95b5..7ce5e7daeb1 100644 --- a/includes/Core/REST_API/Data_Request.php +++ b/includes/Core/REST_API/Data_Request.php @@ -121,6 +121,8 @@ public function __isset( $name ) { * * @return bool */ + // phpcs:disable Squiz.Commenting.InlineComment.WrongStyle,Squiz.Commenting.FunctionComment.WrongStyle, Squiz.PHP.CommentedOutCode.Found + #[\ReturnTypeWillChange] public function offsetExists( $key ) { return array_key_exists( $key, $this->data ); } @@ -132,6 +134,8 @@ public function offsetExists( $key ) { * * @return mixed */ + // phpcs:disable Squiz.Commenting.InlineComment.WrongStyle,Squiz.Commenting.FunctionComment.WrongStyle, Squiz.PHP.CommentedOutCode.Found + #[\ReturnTypeWillChange] public function offsetGet( $key ) { if ( $this->offsetExists( $key ) ) { return $this->data[ $key ]; @@ -146,6 +150,8 @@ public function offsetGet( $key ) { * @param string|int $key Key to set the value for. * @param mixed $value New value for the given key. */ + // phpcs:disable Squiz.Commenting.InlineComment.WrongStyle,Squiz.Commenting.FunctionComment.WrongStyle, Squiz.PHP.CommentedOutCode.Found + #[\ReturnTypeWillChange] public function offsetSet( $key, $value ) { // Data is immutable. } @@ -155,6 +161,8 @@ public function offsetSet( $key, $value ) { * * @param string|int $key Key to unset. */ + // phpcs:disable Squiz.Commenting.InlineComment.WrongStyle,Squiz.Commenting.FunctionComment.WrongStyle, Squiz.PHP.CommentedOutCode.Found + #[\ReturnTypeWillChange] public function offsetUnset( $key ) { // Data is immutable. }