SocketInterface
last analyzed

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 48

7 Methods

Rating   Name   Duplication   Size   Complexity  
enableCrypto() 0 1 ?
connect() 0 1 ?
disconnect() 0 1 ?
eof() 0 1 ?
gets() 0 1 ?
read() 0 1 ?
write() 0 1 ?
1
<?php
2
3
/*
4
 * This file is part of the NNTP library.
5
 *
6
 * (c) Robin van der Vleuten <[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 Rvdv\Nntp\Socket;
13
14
/**
15
 * @author Robin van der Vleuten <[email protected]>
16
 */
17
interface SocketInterface
18
{
19
    /**
20
     * @param bool $enable
21
     * @param int  $cryptoType
22
     *
23
     * @return self
24
     */
25
    public function enableCrypto($enable, $cryptoType = STREAM_CRYPTO_METHOD_TLS_CLIENT);
26
27
    /**
28
     * @param string $address
29
     *
30
     * @return self
31
     */
32
    public function connect($address);
33
34
    /**
35
     * @return self
36
     */
37
    public function disconnect();
38
39
    /**
40
     * @return bool
41
     */
42
    public function eof();
43
44
    /**
45
     * @param int $length
46
     *
47
     * @return string
48
     */
49
    public function gets($length = null);
50
51
    /**
52
     * @param int $length
53
     *
54
     * @return string
55
     */
56
    public function read($length);
57
58
    /**
59
     * @param $data
60
     *
61
     * @return int
62
     */
63
    public function write($data);
64
}
65