Skip to content

Commit

Permalink
Added return type for offset*() methods
Browse files Browse the repository at this point in the history
  • Loading branch information
aimeos committed Dec 19, 2021
1 parent 059b73d commit 1e828f0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Map.php
Original file line number Diff line number Diff line change
Expand Up @@ -2295,6 +2295,7 @@ public function offsetExists( $key ) : bool
* @param int|string $key Key to return the element for
* @return mixed Value associated to the given key
*/
#[\ReturnTypeWillChange]
public function offsetGet( $key )
{
return $this->list[$key] ?? null;
Expand All @@ -2315,7 +2316,7 @@ public function offsetGet( $key )
* @param int|string|null $key Key to set the element for or NULL to append value
* @param mixed $value New value set for the key
*/
public function offsetSet( $key, $value )
public function offsetSet( $key, $value ) : void
{
if( $key !== null ) {
$this->list[$key] = $value;
Expand All @@ -2337,7 +2338,7 @@ public function offsetSet( $key, $value )
*
* @param int|string $key Key for unsetting the item
*/
public function offsetUnset( $key )
public function offsetUnset( $key ) : void
{
unset( $this->list[$key] );
}
Expand Down

0 comments on commit 1e828f0

Please sign in to comment.