Total Complexity | 3 |
Total Lines | 35 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
11 | class Protocol |
||
12 | { |
||
13 | public const CRLF = "\r\n"; |
||
14 | public const SPLIT = self::CRLF.self::CRLF; |
||
15 | |||
16 | /** |
||
17 | * @var resource |
||
18 | */ |
||
19 | private $fd = null; |
||
20 | |||
21 | /** |
||
22 | * Socket constructor. |
||
23 | * @param $resource |
||
24 | */ |
||
25 | public function __construct($resource) |
||
26 | { |
||
27 | $this->fd = $resource; |
||
28 | } |
||
29 | |||
30 | /** |
||
31 | * @param int $size |
||
32 | * @return string |
||
33 | */ |
||
34 | public function read(int $size) : string |
||
37 | } |
||
38 | |||
39 | /** |
||
40 | * @param string $data |
||
41 | * @return int |
||
42 | */ |
||
43 | public function write(string $data) : int |
||
48 |