Conditions | 3 |
Paths | 4 |
Total Lines | 10 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
44 | function assertStream(string $type, StreamInterface $stream, int $position = null): void |
||
45 | { |
||
46 | 2 | $message = ''; |
|
47 | |||
48 | 2 | if (is_int($position)) { |
|
49 | 2 | $message = "Argument $position must be of type StreamInterface<$type>"; |
|
50 | } |
||
51 | |||
52 | 2 | if ((string) $stream->type() !== $type) { |
|
53 | 2 | throw new \TypeError($message); |
|
54 | } |
||
56 |