Skip to content

Commit

Permalink
Fix psalm issues in PerfectHasher
Browse files Browse the repository at this point in the history
  • Loading branch information
vudaltsov committed Sep 4, 2024
1 parent ac3f83a commit 542f4af
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Internal/PerfectHasher.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Typhoon\DataStructures\KVPair;

/**
* @see https://en.wikipedia.org/wiki/Perfect_hash_function
* @internal
* @psalm-internal Typhoon\DataStructures
*/
Expand Down
2 changes: 2 additions & 0 deletions tests/Internal/PerfectHasherTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
Expand All @@ -95,6 +96,7 @@ public function testMemoizedObjectHashIsNotSameForDifferentInstancesOfTheSameCla
{
$hasher = new PerfectHasher();
$hasher->registerObjectNormalizer(\stdClass::class, static function (): int {
/** @var int */
static $hash = 0;

return $hash++;
Expand Down

0 comments on commit 542f4af

Please sign in to comment.