1 | <?php |
||
17 | class StandardOutputStream implements OutputStream |
||
18 | { |
||
19 | |||
20 | /** |
||
21 | * Interceptor |
||
22 | * |
||
23 | * @var StreamInterceptor |
||
24 | */ |
||
25 | private $interceptor; |
||
26 | |||
27 | /** |
||
28 | * The standard out channel |
||
29 | * |
||
30 | * @var resource |
||
31 | */ |
||
32 | private $stdout; |
||
33 | |||
34 | /** |
||
35 | * Create a new instance of StandardOutputStream |
||
36 | */ |
||
37 | 1 | public function __construct() |
|
41 | |||
42 | /** |
||
43 | * Opens a new standard output channel |
||
44 | */ |
||
45 | 1 | private function open() |
|
49 | |||
50 | /** |
||
51 | * |
||
52 | * {@inheritdoc} |
||
53 | * @see \Generics\Streams\Stream::isOpen() |
||
54 | */ |
||
55 | 1 | public function isOpen(): bool |
|
59 | |||
60 | /** |
||
61 | * |
||
62 | * {@inheritdoc} |
||
63 | * @see \Generics\Streams\OutputStream::flush() |
||
64 | */ |
||
65 | 1 | public function flush() |
|
74 | |||
75 | /** |
||
76 | * |
||
77 | * {@inheritdoc} |
||
78 | * @see \Generics\Streams\Stream::ready() |
||
79 | */ |
||
80 | 1 | public function ready(): bool |
|
84 | |||
85 | /** |
||
86 | * |
||
87 | * {@inheritdoc} |
||
88 | * @see Countable::count() |
||
89 | */ |
||
90 | 1 | public function count() |
|
94 | |||
95 | /** |
||
96 | * |
||
97 | * {@inheritdoc} |
||
98 | * @see \Generics\Resettable::reset() |
||
99 | */ |
||
100 | 1 | public function reset() |
|
110 | |||
111 | /** |
||
112 | * |
||
113 | * {@inheritdoc} |
||
114 | * @see \Generics\Streams\OutputStream::write() |
||
115 | */ |
||
116 | 1 | public function write($buffer) |
|
122 | |||
123 | /** |
||
124 | * |
||
125 | * {@inheritdoc} |
||
126 | * @see \Generics\Streams\Stream::close() |
||
127 | */ |
||
128 | 1 | public function close() |
|
135 | |||
136 | /** |
||
137 | * |
||
138 | * {@inheritdoc} |
||
139 | * @see \Generics\Streams\OutputStream::isWriteable() |
||
140 | */ |
||
141 | 1 | public function isWriteable(): bool |
|
145 | |||
146 | /** |
||
147 | * Apply a stream interceptor |
||
148 | * |
||
149 | * @param StreamInterceptor $interceptor |
||
150 | */ |
||
151 | 1 | public function setInterceptor(StreamInterceptor $interceptor) |
|
156 | } |