Skip to content

Commit 05fabbf

Browse files
committed
Use spl_object_id() instead of spl_object_hash()
1 parent 07212a5 commit 05fabbf

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Tests/LockTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -476,18 +476,18 @@ public function testAcquireReadTwiceWithExpiration()
476476
public function save(Key $key): void
477477
{
478478
$key->reduceLifetime($this->initialTtl);
479-
$this->keys[spl_object_hash($key)] = $key;
479+
$this->keys[spl_object_id($key)] = $key;
480480
$this->checkNotExpired($key);
481481
}
482482

483483
public function delete(Key $key): void
484484
{
485-
unset($this->keys[spl_object_hash($key)]);
485+
unset($this->keys[spl_object_id($key)]);
486486
}
487487

488488
public function exists(Key $key): bool
489489
{
490-
return isset($this->keys[spl_object_hash($key)]);
490+
return isset($this->keys[spl_object_id($key)]);
491491
}
492492

493493
public function putOffExpiration(Key $key, $ttl): void
@@ -520,18 +520,18 @@ public function testAcquireTwiceWithExpiration()
520520
public function save(Key $key): void
521521
{
522522
$key->reduceLifetime($this->initialTtl);
523-
$this->keys[spl_object_hash($key)] = $key;
523+
$this->keys[spl_object_id($key)] = $key;
524524
$this->checkNotExpired($key);
525525
}
526526

527527
public function delete(Key $key): void
528528
{
529-
unset($this->keys[spl_object_hash($key)]);
529+
unset($this->keys[spl_object_id($key)]);
530530
}
531531

532532
public function exists(Key $key): bool
533533
{
534-
return isset($this->keys[spl_object_hash($key)]);
534+
return isset($this->keys[spl_object_id($key)]);
535535
}
536536

537537
public function putOffExpiration(Key $key, $ttl): void

0 commit comments

Comments
 (0)