1 | <?php |
||
17 | class StreamState |
||
18 | { |
||
19 | const STATE_CREATED = 0; |
||
20 | |||
21 | const STATE_READY = 1; |
||
22 | |||
23 | const STATE_CLOSED = 2; |
||
24 | |||
25 | /** |
||
26 | * @var int |
||
27 | */ |
||
28 | private $state = self::STATE_CREATED; |
||
29 | |||
30 | 45 | public function open() |
|
38 | |||
39 | 62 | public function close() |
|
51 | |||
52 | /** |
||
53 | * Stream is ready to receive data. |
||
54 | * |
||
55 | * @return bool |
||
56 | */ |
||
57 | 36 | public function isReady() |
|
61 | |||
62 | /** |
||
63 | * Did you not forget to close the stream? |
||
64 | */ |
||
65 | 39 | public function __destruct() |
|
71 | } |
||
72 |