| Conditions | 1 |
| Paths | 1 |
| Total Lines | 19 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 34 | public function __construct(string $algorithm, string $path) |
||
| 35 | { |
||
| 36 | $algorithm = strtolower( |
||
| 37 | preg_replace( |
||
| 38 | '/[^A-Za-z0-9]+/', |
||
| 39 | '', |
||
| 40 | $algorithm |
||
| 41 | ) |
||
| 42 | ); |
||
| 43 | |||
| 44 | Assertion::inArray( |
||
| 45 | $algorithm, |
||
| 46 | hash_algos(), |
||
| 47 | 'Expected %s to be a known algorithm: "' |
||
| 48 | .implode('", "', hash_algos()) |
||
| 49 | .'"' |
||
| 50 | ); |
||
| 51 | |||
| 52 | $this->context = hash_init($algorithm); |
||
| 53 | } |
||
| 73 |