From 6e88bcca3985c095ce07d755ba02bf9016ba8838 Mon Sep 17 00:00:00 2001 From: Enrico Battocchi Date: Fri, 11 Mar 2022 10:18:11 +0100 Subject: [PATCH 1/2] Use parameter name from ArrayAccess interface --- lib/orm.php | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/lib/orm.php b/lib/orm.php index a7bbf5e7ca0..03ec66cc57c 100644 --- a/lib/orm.php +++ b/lib/orm.php @@ -2451,50 +2451,50 @@ public function delete_many() { /** * Checks whether the data has the key. * - * @param mixed $key Key. + * @param mixed $offset Key. * * @return bool Whether the data has the key. */ #[ReturnTypeWillChange] - public function offsetExists( $key ) { - return \array_key_exists( $key, $this->data ); + public function offsetExists( $offset ) { + return \array_key_exists( $offset, $this->data ); } /** * Retrieves the value of the key. * - * @param mixed $key Key. + * @param mixed $offset Key. * * @return array|mixed|null The value. */ #[ReturnTypeWillChange] - public function offsetGet( $key ) { - return $this->get( $key ); + public function offsetGet( $offset ) { + return $this->get( $offset ); } /** * Sets the value of the key. * - * @param string|int $key Key. + * @param string|int $offset Key. * @param mixed $value Value. */ #[ReturnTypeWillChange] - public function offsetSet( $key, $value ) { - if ( \is_null( $key ) ) { + public function offsetSet( $offset, $value ) { + if ( \is_null( $offset ) ) { return; } - $this->set( $key, $value ); + $this->set( $offset, $value ); } /** * Removes the given key from the data. * - * @param mixed $key Key. + * @param mixed $offset Key. */ #[ReturnTypeWillChange] - public function offsetUnset( $key ) { - unset( $this->data[ $key ] ); - unset( $this->dirty_fields[ $key ] ); + public function offsetUnset( $offset ) { + unset( $this->data[ $offset ] ); + unset( $this->dirty_fields[ $offset ] ); } /* From d467a79be036086229cf89ecbf63bd9873b08e05 Mon Sep 17 00:00:00 2001 From: Enrico Battocchi Date: Fri, 11 Mar 2022 12:22:20 +0100 Subject: [PATCH 2/2] Fix alignment --- lib/orm.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/orm.php b/lib/orm.php index 03ec66cc57c..7b9a47141a5 100644 --- a/lib/orm.php +++ b/lib/orm.php @@ -2475,8 +2475,8 @@ public function offsetGet( $offset ) { /** * Sets the value of the key. * - * @param string|int $offset Key. - * @param mixed $value Value. + * @param string|int $offset Key. + * @param mixed $value Value. */ #[ReturnTypeWillChange] public function offsetSet( $offset, $value ) {