| Conditions | 1 |
| Paths | 1 |
| Total Lines | 11 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 1 |
| Changes | 0 | ||
| 1 | <?php declare(strict_types=1); |
||
| 24 | 184 | public function __construct(WritableStreamInterface $stream, string $algo, int $options = 0, string $key = '') |
|
| 25 | { |
||
| 26 | 184 | $this->stream = $stream; |
|
| 27 | 184 | $this->context = hash_init($algo, $options, $key); |
|
| 28 | 184 | $this->stream->once('close', function () use ($algo) { |
|
| 29 | 184 | $this->emit('hash', [ |
|
| 30 | 184 | hash_final($this->context), |
|
| 31 | 184 | $algo, |
|
| 32 | ]); |
||
| 33 | 184 | }); |
|
| 34 | 184 | } |
|
| 35 | |||
| 61 |