Lets try some more modern annotations for index key/value typing
This commit is contained in:
parent
34d15b80de
commit
6e497a5fd6
|
|
@ -19,7 +19,7 @@ class HashTable
|
||||||
protected $keyMap = [];
|
protected $keyMap = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new \PhpOffice\PhpSpreadsheet\HashTable.
|
* Create a new HashTable.
|
||||||
*
|
*
|
||||||
* @param IComparable[] $source Optional source array to create HashTable from
|
* @param IComparable[] $source Optional source array to create HashTable from
|
||||||
*/
|
*/
|
||||||
|
|
@ -39,7 +39,7 @@ class HashTable
|
||||||
public function addFromSource(?array $source = null): void
|
public function addFromSource(?array $source = null): void
|
||||||
{
|
{
|
||||||
// Check if an array was passed
|
// Check if an array was passed
|
||||||
if ($source == null) {
|
if ($source === null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -109,11 +109,9 @@ class HashTable
|
||||||
/**
|
/**
|
||||||
* Get index for hash code.
|
* Get index for hash code.
|
||||||
*
|
*
|
||||||
* @param string $hashCode
|
|
||||||
*
|
|
||||||
* @return false|int Index
|
* @return false|int Index
|
||||||
*/
|
*/
|
||||||
public function getIndexForHashCode($hashCode)
|
public function getIndexForHashCode(string $hashCode)
|
||||||
{
|
{
|
||||||
return array_search($hashCode, $this->keyMap, true);
|
return array_search($hashCode, $this->keyMap, true);
|
||||||
}
|
}
|
||||||
|
|
@ -121,8 +119,6 @@ class HashTable
|
||||||
/**
|
/**
|
||||||
* Get by index.
|
* Get by index.
|
||||||
*
|
*
|
||||||
* @param int $index
|
|
||||||
*
|
|
||||||
* @return IComparable
|
* @return IComparable
|
||||||
*/
|
*/
|
||||||
public function getByIndex(int $index)
|
public function getByIndex(int $index)
|
||||||
|
|
@ -137,8 +133,6 @@ class HashTable
|
||||||
/**
|
/**
|
||||||
* Get by hashcode.
|
* Get by hashcode.
|
||||||
*
|
*
|
||||||
* @param string $hashCode
|
|
||||||
*
|
|
||||||
* @return IComparable
|
* @return IComparable
|
||||||
*/
|
*/
|
||||||
public function getByHashCode(string $hashCode)
|
public function getByHashCode(string $hashCode)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue