Skip to content

Commit

Permalink
fix: Add return types
Browse files Browse the repository at this point in the history
  • Loading branch information
itssimple committed Jan 10, 2024
1 parent 4d674d2 commit ae0f126
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions libraries/class-recursive-arrayaccess.php
Expand Up @@ -61,7 +61,7 @@ public function __clone() {
*
* @return array
*/
public function toArray() {
public function toArray() : array {
$data = $this->container;
foreach ( $data as $key => $value ) {
if ( $value instanceof self ) {
Expand All @@ -83,7 +83,7 @@ public function toArray() {
*
* @return boolean true on success or false on failure.
*/
public function offsetExists( $offset ) {
public function offsetExists( $offset ) : bool {
return isset( $this->container[ $offset ] );
}

Expand All @@ -96,7 +96,7 @@ public function offsetExists( $offset ) {
*
* @return mixed Can return all value types.
*/
public function offsetGet( $offset ) {
public function offsetGet( $offset ) : mixed {
return isset( $this->container[ $offset ] ) ? $this->container[ $offset ] : null;
}

Expand All @@ -110,7 +110,7 @@ public function offsetGet( $offset ) {
*
* @return void
*/
public function offsetSet( $offset, $data ) {
public function offsetSet( $offset, $data ) : void {
if ( is_array( $data ) ) {
$data = new self( $data );
}
Expand All @@ -131,7 +131,7 @@ public function offsetSet( $offset, $data ) {
*
* @return void
*/
public function offsetUnset( $offset ) {
public function offsetUnset( $offset ) : void {
unset( $this->container[ $offset ] );
}
}

0 comments on commit ae0f126

Please sign in to comment.