1 | <?php |
||
18 | abstract class AbstractReader |
||
19 | { |
||
20 | /** |
||
21 | * @var StreamInterface |
||
22 | */ |
||
23 | protected $stream; |
||
24 | |||
25 | /** |
||
26 | * Create reader object |
||
27 | * |
||
28 | * @throws Exception\InvalidArgumentException An exception will be thrown for non-readable streams |
||
29 | * |
||
30 | * @param StreamInterface $stream |
||
31 | */ |
||
32 | public function __construct(StreamInterface $stream) |
||
40 | |||
41 | /** |
||
42 | * Get stream |
||
43 | * |
||
44 | * @return StreamInterface |
||
45 | */ |
||
46 | public function getStream() |
||
50 | |||
51 | /** |
||
52 | * Read data from the stream |
||
53 | * |
||
54 | * @return mixed |
||
55 | */ |
||
56 | abstract public function read(); |
||
57 | } |
||
58 |