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