OutputStream::write()
last analyzed

Size

Total Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 1
1
<?php
2
3
/*
4
 * This file is part of the webmozart/console package.
5
 *
6
 * (c) Bernhard Schussek <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Webmozart\Console\Api\IO;
13
14
/**
15
 * The console output stream.
16
 *
17
 * @since  1.0
18
 *
19
 * @author Bernhard Schussek <[email protected]>
20
 */
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);
0 ignored issues
show
Documentation introduced by
For interfaces and abstract methods it is generally a good practice to add a @return annotation even if it is just @return void or @return null, so that implementors know what to do in the overridden method.

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.

Loading history...
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();
0 ignored issues
show
Documentation introduced by
For interfaces and abstract methods it is generally a good practice to add a @return annotation even if it is just @return void or @return null, so that implementors know what to do in the overridden method.

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.

Loading history...
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();
0 ignored issues
show
Documentation introduced by
For interfaces and abstract methods it is generally a good practice to add a @return annotation even if it is just @return void or @return null, so that implementors know what to do in the overridden method.

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.

Loading history...
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