Passed
Branch main (7c3c91)
by Eric
15:48
created

MockHasher   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 12
rs 10
wmc 3
1
<?php
2
3
declare(strict_types=1);
4
5
/**
6
 * This file is part of Esi\ConsistentHash.
7
 *
8
 * (c) Eric Sizemore <[email protected]>
9
 * (c) Paul Annesley <[email protected]>
10
 *
11
 * This source file is subject to the MIT license. For the full copyright and
12
 * license information, please view the LICENSE file that was distributed with
13
 * this source code.
14
 */
15
16
namespace Esi\ConsistentHash\Tests\Hasher;
17
18
use Esi\ConsistentHash\Hasher\HasherInterface;
19
20
/**
21
 * @internal
22
 */
23
class MockHasher implements HasherInterface
24
{
25
    public function __construct(private int $hashValue) {}
26
27
    public function hash(string $string): int
28
    {
29
        return $this->hashValue;
30
    }
31
32
    public function setHashValue(int $hash): void
33
    {
34
        $this->hashValue = $hash;
35
    }
36
}
37