@@ -18,8 +18,8 @@ class HLookup extends LookupBase
1818 * in the same column based on the index_number.
1919 *
2020 * @param mixed $lookupValue The value that you want to match in lookup_array
21- * @param array $lookupArray The range of cells being searched
22- * @param array|float|int|string $indexNumber The row number in table_array from which the matching value must be returned.
21+ * @param mixed[][] $lookupArray The range of cells being searched
22+ * @param array<mixed> |float|int|string $indexNumber The row number in table_array from which the matching value must be returned.
2323 * The first row is 1.
2424 * @param mixed $notExactMatch determines if you are looking for an exact match based on lookup_value
2525 *
@@ -49,6 +49,7 @@ public static function lookup(mixed $lookupValue, $lookupArray, $indexNumber, mi
4949
5050 $ firstkey = $ f [0 ] - 1 ;
5151 $ returnColumn = $ firstkey + $ indexNumber ;
52+ /** @var mixed[][] $lookupArray */
5253 $ firstColumn = array_shift ($ f ) ?? 1 ;
5354 $ rowNumber = self ::hLookupSearch ($ lookupValue , $ lookupArray , $ firstColumn , $ notExactMatch );
5455
@@ -62,6 +63,7 @@ public static function lookup(mixed $lookupValue, $lookupArray, $indexNumber, mi
6263
6364 /**
6465 * @param mixed $lookupValue The value that you want to match in lookup_array
66+ * @param mixed[][] $lookupArray
6567 * @param int|string $column
6668 */
6769 private static function hLookupSearch (mixed $ lookupValue , array $ lookupArray , $ column , bool $ notExactMatch ): ?int
@@ -71,8 +73,10 @@ private static function hLookupSearch(mixed $lookupValue, array $lookupArray, $c
7173 $ rowNumber = null ;
7274 foreach ($ lookupArray [$ column ] as $ rowKey => $ rowData ) {
7375 // break if we have passed possible keys
76+ /** @var string $rowKey */
7477 $ bothNumeric = is_numeric ($ lookupValue ) && is_numeric ($ rowData );
7578 $ bothNotNumeric = !is_numeric ($ lookupValue ) && !is_numeric ($ rowData );
79+ /** @var scalar $rowData */
7680 $ cellDataLower = StringHelper::strToLower ((string ) $ rowData );
7781
7882 if (
@@ -96,6 +100,11 @@ private static function hLookupSearch(mixed $lookupValue, array $lookupArray, $c
96100 return $ rowNumber ;
97101 }
98102
103+ /**
104+ * @param mixed[] $lookupArray
105+ *
106+ * @return mixed[]
107+ */
99108 private static function convertLiteralArray (array $ lookupArray ): array
100109 {
101110 if (array_key_exists (0 , $ lookupArray )) {
0 commit comments