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