| Total Complexity | 4 |
| Total Lines | 38 |
| Duplicated Lines | 0 % |
| Coverage | 92.86% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 20 | class MessagePartStreamDecorator implements StreamInterface |
||
| 21 | { |
||
| 22 | use StreamDecoratorTrait { |
||
| 23 | read as private decoratorRead; |
||
| 24 | } |
||
| 25 | |||
| 26 | /** |
||
| 27 | * @var IMessagePart The part to read from. |
||
| 28 | */ |
||
| 29 | protected IMessagePart $part; |
||
| 30 | |||
| 31 | protected ?StreamInterface $stream; |
||
| 32 | |||
| 33 | 107 | public function __construct(IMessagePart $part, ?StreamInterface $stream = null) |
|
| 37 | } |
||
| 38 | |||
| 39 | /** |
||
| 40 | * Overridden to wrap exceptions in MessagePartReadException which provides |
||
| 41 | * 'getPart' to inspect the part the error occurs on. |
||
| 42 | * |
||
| 43 | * @throws MessagePartStreamReadException |
||
| 44 | */ |
||
| 45 | 105 | public function read(int $length) : string |
|
| 62 |