| Conditions | 3 |
| Paths | 2 |
| Total Lines | 11 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 12 | public function addHash(string $algorithm, string $hash): HashContainer |
||
| 13 | { |
||
| 14 | if (array_key_exists($algorithm, $this->map) && $this->map[$algorithm] !== $hash) |
||
| 15 | { |
||
| 16 | throw new \LogicException("Trying to update existing hash with different hash for the algorithm '{$algorithm}'"); |
||
| 17 | } |
||
| 18 | |||
| 19 | $this->map[$algorithm] = $hash; |
||
| 20 | |||
| 21 | return $this; |
||
| 22 | } |
||
| 23 | |||
| 85 |