diff --git a/src/Internal/PerfectHasher.php b/src/Internal/PerfectHasher.php index 671dea1..cf98955 100644 --- a/src/Internal/PerfectHasher.php +++ b/src/Internal/PerfectHasher.php @@ -7,6 +7,7 @@ use Typhoon\DataStructures\KVPair; /** + * @see https://en.wikipedia.org/wiki/Perfect_hash_function * @internal * @psalm-internal Typhoon\DataStructures */ diff --git a/tests/Internal/PerfectHasherTest.php b/tests/Internal/PerfectHasherTest.php index faa9c61..a24b75e 100644 --- a/tests/Internal/PerfectHasherTest.php +++ b/tests/Internal/PerfectHasherTest.php @@ -78,6 +78,7 @@ public function testObjectHashIsMemoizedForSameInstance(): void { $hasher = new PerfectHasher(); $hasher->registerObjectNormalizer(\stdClass::class, static function (): int { + /** @var int */ static $hash = 0; return $hash++; @@ -95,6 +96,7 @@ public function testMemoizedObjectHashIsNotSameForDifferentInstancesOfTheSameCla { $hasher = new PerfectHasher(); $hasher->registerObjectNormalizer(\stdClass::class, static function (): int { + /** @var int */ static $hash = 0; return $hash++;