Skip to content

Commit 2a467d2

Browse files
committed
Mark internal API as private to discourage inheritance
1 parent 1284eba commit 2a467d2

File tree

2 files changed

+16
-12
lines changed

2 files changed

+16
-12
lines changed

src/DuplexResourceStream.php

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88

99
class DuplexResourceStream extends EventEmitter implements DuplexStreamInterface
1010
{
11+
private $stream;
12+
private $loop;
13+
1114
/**
1215
* Controls the maximum buffer size in bytes to read at once from the stream.
1316
*
@@ -25,13 +28,11 @@ class DuplexResourceStream extends EventEmitter implements DuplexStreamInterface
2528
* @var int
2629
*/
2730
private $bufferSize;
31+
private $buffer;
2832

29-
private $stream;
30-
protected $readable = true;
31-
protected $writable = true;
32-
protected $closing = false;
33-
protected $loop;
34-
protected $buffer;
33+
private $readable = true;
34+
private $writable = true;
35+
private $closing = false;
3536

3637
public function __construct($stream, LoopInterface $loop, $readChunkSize = null, WritableStreamInterface $buffer = null)
3738
{
@@ -157,6 +158,7 @@ public function pipe(WritableStreamInterface $dest, array $options = array())
157158
return Util::pipe($this, $dest, $options);
158159
}
159160

161+
/** @internal */
160162
public function handleData($stream)
161163
{
162164
$error = null;
@@ -189,6 +191,7 @@ public function handleData($stream)
189191
}
190192
}
191193

194+
/** @internal */
192195
public function handleClose()
193196
{
194197
if (is_resource($this->stream)) {

src/ReadableResourceStream.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@
88

99
class ReadableResourceStream extends EventEmitter implements ReadableStreamInterface
1010
{
11+
/**
12+
* @var resource
13+
*/
14+
private $stream;
15+
16+
private $loop;
17+
1118
/**
1219
* Controls the maximum buffer size in bytes to read at once from the stream.
1320
*
@@ -28,13 +35,7 @@ class ReadableResourceStream extends EventEmitter implements ReadableStreamInter
2835
*/
2936
private $bufferSize;
3037

31-
/**
32-
* @var resource
33-
*/
34-
private $stream;
35-
3638
private $closed = false;
37-
private $loop;
3839

3940
public function __construct($stream, LoopInterface $loop, $readChunkSize = null)
4041
{

0 commit comments

Comments
 (0)