StreamInterface::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
namespace Phloppy\Stream;
4
5
use Phloppy\Exception\ConnectException;
6
7
interface StreamInterface
8
{
9
10
    /**
11
     * Close the stream.
12
     *
13
     * @return bool True on success.
14
     */
15
    public function close();
0 ignored issues
show
Coding Style introduced by
function close() does not seem to conform to the naming convention (^(?:is|has|should|may|supports)).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

Loading history...
16
17
18
    /**
19
     * Check if the stream is connected.
20
     *
21
     * @return boolean True if the stream is connected.
22
     */
23
    public function isConnected();
24
25
26
    /**
27
     * Establish a connection.
28
     *
29
     * @return void
30
     * @throws ConnectException
31
     */
32
    public function connect();
33
34
35
    /**
36
     * Read a line from the stream.
37
     *
38
     * @return string
39
     */
40
    public function readLine();
41
42
43
    /**
44
     * Read bytes off from the stream.
45
     *
46
     * @param int|null $maxlen
47
     *
48
     * @return string The response.
49
     */
50
    public function readBytes($maxlen = null);
51
52
53
    /**
54
     * Write the given message to the stream.
55
     *
56
     * @param string   $msg
57
     * @param int|null $len
58
     *
59
     * @return StreamInterface the instance.
60
     */
61
    public function write($msg, $len = null);
62
63
64
    /**
65
     * return the internal stream url.
66
     *
67
     * @return string
68
     */
69
    public function getNodeUrl();
70
}
71