1 | <?php |
||
5 | final class HashContainer implements \Countable, \IteratorAggregate, \Serializable |
||
6 | { |
||
7 | /** |
||
8 | * @var array |
||
9 | */ |
||
10 | protected $map = []; |
||
11 | |||
12 | public function addHash(string $algorithm, string $hash): HashContainer |
||
23 | |||
24 | public function hasHash(string $algorithm): bool |
||
28 | |||
29 | public function getHash(string $algorithm): ?string |
||
33 | |||
34 | /** |
||
35 | * Compares the given instance to this instance. |
||
36 | * They are called equal if the intersection of known hash values is equal. |
||
37 | * |
||
38 | * @param HashContainer $other |
||
39 | * @return bool |
||
40 | */ |
||
41 | public function equals(?HashContainer $other): bool |
||
50 | |||
51 | /** |
||
52 | * {@inheritdoc} |
||
53 | */ |
||
54 | public function count(): int |
||
58 | |||
59 | /** |
||
60 | * {@inheritdoc} |
||
61 | */ |
||
62 | public function getIterator(): \Iterator |
||
66 | |||
67 | /** |
||
68 | * {@inheritdoc} |
||
69 | */ |
||
70 | public function serialize(): string |
||
74 | |||
75 | /** |
||
76 | * {@inheritdoc} |
||
77 | */ |
||
78 | public function unserialize($serialized): HashContainer |
||
84 | } |
||
85 |