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