| Conditions | 2 |
| Paths | 2 |
| Total Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 5 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 33 | 4 | public function setHashAlgorithm(string $hashAlgorithm) |
|
| 34 | { |
||
| 35 | /* |
||
| 36 | * check if hashing algorithm is valid |
||
| 37 | */ |
||
| 38 | 4 | if (!in_array($hashAlgorithm, hash_algos(), true)) { |
|
| 39 | 1 | throw new BotonomousException('Hash algorithm is not valid'); |
|
| 40 | } |
||
| 41 | |||
| 42 | 4 | $this->hashAlgorithm = $hashAlgorithm; |
|
| 43 | 4 | } |
|
| 44 | |||
| 59 |