More types

This commit is contained in:
2023-08-02 13:29:14 +00:00
parent 73781e9000
commit a2c5252cf2
6 changed files with 18 additions and 19 deletions

View File

@ -7,8 +7,14 @@ namespace DNW\Skills;
*/
class HashMap
{
/**
* @var mixed[] $hashToValue
*/
private array $hashToValue = [];
/**
* @var mixed[] $hashToKey
*/
private array $hashToKey = [];
public function getValue(string|object $key): mixed
@ -27,11 +33,17 @@ class HashMap
return $this;
}
/**
* @return mixed[]
*/
public function getAllKeys(): array
{
return array_values($this->hashToKey);
}
/**
* @return mixed[]
*/
public function getAllValues(): array
{
return array_values($this->hashToValue);