Skip to content

Commit

Permalink
Fix array access issues in php 8.x
Browse files Browse the repository at this point in the history
  • Loading branch information
cristianuibar committed Apr 15, 2024
1 parent 33eaa99 commit f791e9e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Authentication/ApiKey/ApiKey.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ private function format_date( int $timestamp, string $format = null ): string {
return $datetime->format( $format );
}

#[\ReturnTypeWillChange]
/**
* Whether a field exists.
*
Expand All @@ -191,6 +192,7 @@ public function offsetExists( $name ): bool {
return isset( $this->data[ $name ] );
}

#[\ReturnTypeWillChange]
/**
* Retrieve a field value.
*
Expand All @@ -213,6 +215,7 @@ public function offsetGet( $name ) {
return null;
}

#[\ReturnTypeWillChange]
/**
* Set a field value.
*
Expand All @@ -227,6 +230,7 @@ public function offsetSet( $name, $value ) {
}
}

#[\ReturnTypeWillChange]
/**
* Remove a field.
*
Expand Down
4 changes: 4 additions & 0 deletions src/PackageType/BasePackage.php
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,7 @@ public function is_update_available(): bool {
return $this->is_installed() && version_compare( $this->get_installed_version(), $this->get_latest_version(), '<' );
}

#[\ReturnTypeWillChange]
/**
* Whether a property exists.
*
Expand All @@ -402,6 +403,7 @@ public function offsetExists( $name ): bool {
return method_exists( $this, "get_{$name}" );
}

#[\ReturnTypeWillChange]
/**
* Retrieve a property value.
*
Expand All @@ -420,6 +422,7 @@ public function offsetGet( $name ) {
return $this->$method();
}

#[\ReturnTypeWillChange]
/**
* Set a property value.
*
Expand All @@ -432,6 +435,7 @@ public function offsetSet( $name, $value ) {
// Prevent properties from being modified.
}

#[\ReturnTypeWillChange]
/**
* Unset a property.
*
Expand Down

0 comments on commit f791e9e

Please sign in to comment.