Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add return typehints to Extensions ArrayAccess #53

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/Utilities/Extensions.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class Extensions implements ArrayAccess
* @param mixed $offset
* @return bool
*/
public function offsetExists($offset)
public function offsetExists($offset): bool
{
return isset($this->items[$this->normalizeOffset($offset)]);
}
Expand All @@ -39,7 +39,7 @@ public function offsetExists($offset)
* @throws \GoldSpecDigital\ObjectOrientedOAS\Exceptions\ExtensionDoesNotExistException
* @return mixed can return all value types
*/
public function offsetGet($offset)
public function offsetGet($offset): mixed
{
if (!$this->offsetExists($offset)) {
throw new ExtensionDoesNotExistException("[{$offset}] is not a valid extension.");
Expand All @@ -55,7 +55,7 @@ public function offsetGet($offset)
* @param mixed $offset
* @param mixed $value
*/
public function offsetSet($offset, $value)
public function offsetSet($offset, $value): void
{
if ($value === static::X_EMPTY_VALUE) {
$this->offsetUnset($offset);
Expand All @@ -72,7 +72,7 @@ public function offsetSet($offset, $value)
* @link https://php.net/manual/en/arrayaccess.offsetunset.php
* @param mixed $offset
*/
public function offsetUnset($offset)
public function offsetUnset($offset): void
{
if (!$this->offsetExists($offset)) {
return;
Expand Down