From 34d15b80de2ade851d0a705bb18f3340c5e3f222 Mon Sep 17 00:00:00 2001 From: MarkBaker Date: Sat, 7 Nov 2020 17:41:58 +0100 Subject: [PATCH] Lets try some moew modern annotations for index key/value typing --- src/PhpSpreadsheet/HashTable.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/PhpSpreadsheet/HashTable.php b/src/PhpSpreadsheet/HashTable.php index 445addd6..50446ffc 100644 --- a/src/PhpSpreadsheet/HashTable.php +++ b/src/PhpSpreadsheet/HashTable.php @@ -7,14 +7,14 @@ class HashTable /** * HashTable elements. * - * @var IComparable[] + * @var array */ protected $items = []; /** * HashTable key map. * - * @var string[] + * @var array */ protected $keyMap = []; @@ -115,7 +115,7 @@ class HashTable */ public function getIndexForHashCode($hashCode) { - return array_search($hashCode, $this->keyMap); + return array_search($hashCode, $this->keyMap, true); } /** @@ -125,7 +125,7 @@ class HashTable * * @return IComparable */ - public function getByIndex($index) + public function getByIndex(int $index) { if (isset($this->keyMap[$index])) { return $this->getByHashCode($this->keyMap[$index]); @@ -141,7 +141,7 @@ class HashTable * * @return IComparable */ - public function getByHashCode($hashCode) + public function getByHashCode(string $hashCode) { if (isset($this->items[$hashCode])) { return $this->items[$hashCode];