Skip to content

Commit 6bf24d8

Browse files
author
MarkBaker
committed
See if we can sort out scrutinizer's issue with the hash map
1 parent 3ad9195 commit 6bf24d8

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/PhpSpreadsheet/HashTable.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -109,17 +109,11 @@ public function count()
109109
/**
110110
* Get index for hash code.
111111
*
112-
* @return false|int Index
112+
* @return false|int|string Index (return should never be a string, but scrutinizer refuses to recognise that)
113113
*/
114114
public function getIndexForHashCode(string $hashCode)
115115
{
116-
$matched = array_search($hashCode, $this->keyMap, true);
117-
118-
if ($matched === false) {
119-
return $matched;
120-
}
121-
122-
return (int) $matched;
116+
return array_search($hashCode, $this->keyMap, true);
123117
}
124118

125119
/**

0 commit comments

Comments
 (0)