1 | <?php |
||
10 | abstract class AbstractValue implements ValueInterface |
||
11 | { |
||
12 | /** |
||
13 | * @var mixed |
||
14 | */ |
||
15 | private $value; |
||
16 | |||
17 | /** |
||
18 | * AbstractValue constructor. |
||
19 | * |
||
20 | * @param mixed $value |
||
21 | */ |
||
22 | 46 | public function __construct($value) |
|
26 | |||
27 | /** |
||
28 | * {@inheritdoc} |
||
29 | */ |
||
30 | 25 | public function get() |
|
34 | |||
35 | /** |
||
36 | * {@inheritdoc} |
||
37 | */ |
||
38 | public function equals(ValueInterface $item, $strict = true) : bool |
||
44 | |||
45 | /** |
||
46 | * @param string $string |
||
47 | * The string to hash. |
||
48 | * |
||
49 | * @return string |
||
50 | * The string's hash. |
||
51 | */ |
||
52 | 8 | protected function doHash(string $string) : string |
|
53 | { |
||
54 | 8 | return \sha1($string); |
|
55 | } |
||
56 | |||
57 | /** |
||
58 | * {@inheritdoc} |
||
59 | */ |
||
60 | public function __invoke() |
||
64 | } |
||
65 |