Total Lines | 38 |
Duplicated Lines | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
21 | interface OutputStream |
||
22 | { |
||
23 | /** |
||
24 | * Writes a string to the stream. |
||
25 | * |
||
26 | * @param string $string The string to write. |
||
27 | * |
||
28 | * @throws IOException If writing fails or if the stream is closed. |
||
29 | */ |
||
30 | public function write($string); |
||
31 | |||
32 | /** |
||
33 | * Flushes the stream and forces all pending text to be written out. |
||
34 | * |
||
35 | * @throws IOException If flushing fails or if the stream is closed. |
||
36 | */ |
||
37 | public function flush(); |
||
38 | |||
39 | /** |
||
40 | * Returns whether the stream supports ANSI format codes. |
||
41 | * |
||
42 | * @return bool Returns `true` if the stream supports ANSI format codes and |
||
43 | * `false` otherwise. |
||
44 | */ |
||
45 | public function supportsAnsi(); |
||
46 | |||
47 | /** |
||
48 | * Closes the stream. |
||
49 | */ |
||
50 | public function close(); |
||
51 | |||
52 | /** |
||
53 | * Returns whether the stream is closed. |
||
54 | * |
||
55 | * @return bool Returns `true` if the stream is closed. |
||
56 | */ |
||
57 | public function isClosed(); |
||
58 | } |
||
59 |
For interface and abstract methods, it is impossible to infer the return type from the immediate code. In these cases, it is generally advisible to explicitly annotate these methods with a
@return
doc comment to communicate to implementors of these methods what they are expected to return.