| Conditions | 2 |
| Paths | 2 |
| Total Lines | 8 |
| Code Lines | 4 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 5 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 37 | 5 | public function hex2bin(StreamInterface $hexStream): StreamInterface |
|
| 38 | { |
||
| 39 | 5 | $hex = $hexStream->getContents(); |
|
| 40 | 5 | if (!ctype_xdigit($hex)) { |
|
| 41 | 1 | throw new InvalidMessageException("Invalid hex as input"); |
|
| 42 | } |
||
| 43 | |||
| 44 | 4 | return new Stream($this->createStream(pack("H*", $hex))); |
|
| 45 | } |
||
| 47 |