From bc71f851c0b44c8657418b6da6c98feb21869313 Mon Sep 17 00:00:00 2001 From: Jason Judge Date: Thu, 6 Jan 2022 18:26:45 +0000 Subject: [PATCH] Add return typehints to Extensions ArrayAccess See https://github.com/goldspecdigital/oooas/issues/52 --- src/Utilities/Extensions.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Utilities/Extensions.php b/src/Utilities/Extensions.php index 8ad262b..9a40243 100644 --- a/src/Utilities/Extensions.php +++ b/src/Utilities/Extensions.php @@ -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)]); } @@ -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."); @@ -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); @@ -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;