Conditions | 3 |
Paths | 3 |
Total Lines | 14 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 12 |
Changes | 0 |
1 | <?php |
||
12 | /** |
||
13 | * @var StreamUtil |
||
14 | */ |
||
15 | private $stream; |
||
16 | |||
17 | 9 | public function __construct() |
|
18 | { |
||
19 | 9 | $this->stream = new StreamUtil(); |
|
20 | 9 | } |
|
21 | |||
22 | 1 | public function parsePayload(StreamInterface $stream): array |
|
23 | { |
||
24 | 1 | if ($stream->getSize() < 12) { |
|
25 | throw new \Exception("Malformed data (size too small)"); |
||
26 | } |
||
56 |