Skip to content

Commit

Permalink
[Stream] Rename (ReadableStream|WritableStream){ => Interface}
Browse files Browse the repository at this point in the history
For the record, I disagree with this. But I will cry in my corner for this
one.
  • Loading branch information
igorw committed Jul 7, 2012
1 parent 7a08a27 commit a8cf905
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions Buffer.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

use Evenement\EventEmitter;
use React\EventLoop\LoopInterface;
use React\Stream\WritableStream;
use React\Stream\WritableStreamInterface;

class Buffer extends EventEmitter implements WritableStream
class Buffer extends EventEmitter implements WritableStreamInterface
{
public $stream;
public $listening = false;
Expand Down
4 changes: 2 additions & 2 deletions ReadableStream.php → ReadableStreamInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
use Evenement\EventEmitterInterface;

// Events: data, end, error, close
interface ReadableStream extends EventEmitterInterface
interface ReadableStreamInterface extends EventEmitterInterface
{
public function isReadable();
public function pause();
public function resume();
public function close();
public function pipe(WritableStream $dest, array $options = array());
public function pipe(WritableStreamInterface $dest, array $options = array());
}
4 changes: 2 additions & 2 deletions Stream.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use Evenement\EventEmitter;
use React\EventLoop\LoopInterface;

class Stream extends EventEmitter implements ReadableStream, WritableStream
class Stream extends EventEmitter implements ReadableStreamInterface, WritableStreamInterface
{
public $bufferSize = 4096;
public $stream;
Expand Down Expand Up @@ -104,7 +104,7 @@ public function end($data = null)
$this->buffer->end($data);
}

public function pipe(WritableStream $dest, array $options = array())
public function pipe(WritableStreamInterface $dest, array $options = array())
{
Util::pipe($this, $dest, $options);

Expand Down
2 changes: 1 addition & 1 deletion Util.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

class Util
{
public static function pipe(ReadableStream $source, WritableStream $dest, array $options = array())
public static function pipe(ReadableStreamInterface $source, WritableStreamInterface $dest, array $options = array())
{
// TODO: use stream_copy_to_stream
// it is 4x faster than this
Expand Down
2 changes: 1 addition & 1 deletion WritableStream.php → WritableStreamInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use Evenement\EventEmitterInterface;

// Events: drain, error, close, pipe
interface WritableStream extends EventEmitterInterface
interface WritableStreamInterface extends EventEmitterInterface
{
public function isWritable();
public function write($data);
Expand Down

0 comments on commit a8cf905

Please sign in to comment.