Skip to content

Commit

Permalink
Merge pull request #18187 from Yoast/DUPP-337-fix-overloaded-methods-…
Browse files Browse the repository at this point in the history
…orm.php

DUPP-337 Use parameter name from ArrayAccess interface in orm.php
  • Loading branch information
leonidasmi authored Mar 11, 2022
2 parents b22dc7f + d467a79 commit 253a3bf
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions lib/orm.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 mixed $value Value.
* @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 ] );
}

/*
Expand Down

0 comments on commit 253a3bf

Please sign in to comment.