Subversion Repositories php-qbpwcf

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
3 liveuser 1
<?php
2
 
3
namespace React\Tests\Socket\Stub;
4
 
5
use Evenement\EventEmitter;
6
use React\Socket\ConnectionInterface;
7
use React\Stream\WritableStreamInterface;
8
use React\Stream\Util;
9
 
10
class ConnectionStub extends EventEmitter implements ConnectionInterface
11
{
12
    private $data = '';
13
 
14
    public function isReadable()
15
    {
16
        return true;
17
    }
18
 
19
    public function isWritable()
20
    {
21
        return true;
22
    }
23
 
24
    public function pause()
25
    {
26
    }
27
 
28
    public function resume()
29
    {
30
    }
31
 
32
    public function pipe(WritableStreamInterface $dest, array $options = array())
33
    {
34
        Util::pipe($this, $dest, $options);
35
 
36
        return $dest;
37
    }
38
 
39
    public function write($data)
40
    {
41
        $this->data .= $data;
42
 
43
        return true;
44
    }
45
 
46
    public function end($data = null)
47
    {
48
    }
49
 
50
    public function close()
51
    {
52
    }
53
 
54
    public function getData()
55
    {
56
        return $this->data;
57
    }
58
 
59
    public function getRemoteAddress()
60
    {
61
        return '127.0.0.1';
62
    }
63
}