@@ -35,14 +35,13 @@ class Stream extends EventEmitter implements DuplexStreamInterface
3535
3636 public function __construct ($ stream , LoopInterface $ loop , WritableStreamInterface $ buffer = null )
3737 {
38- $ this ->stream = $ stream ;
39- if (!is_resource ($ this ->stream ) || get_resource_type ($ this ->stream ) !== "stream " ) {
38+ if (!is_resource ($ stream ) || get_resource_type ($ stream ) !== "stream " ) {
4039 throw new InvalidArgumentException ('First parameter must be a valid stream resource ' );
4140 }
4241
4342 // this class relies on non-blocking I/O in order to not interrupt the event loop
4443 // e.g. pipes on Windows do not support this: https://bugs.php.net/bug.php?id=47918
45- if (stream_set_blocking ($ this -> stream , 0 ) !== true ) {
44+ if (stream_set_blocking ($ stream , 0 ) !== true ) {
4645 throw new \RuntimeException ('Unable to set stream resource to non-blocking mode ' );
4746 }
4847
@@ -53,13 +52,14 @@ public function __construct($stream, LoopInterface $loop, WritableStreamInterfac
5352 // This does not affect the default event loop implementation (level
5453 // triggered), so we can ignore platforms not supporting this (HHVM).
5554 if (function_exists ('stream_set_read_buffer ' )) {
56- stream_set_read_buffer ($ this -> stream , 0 );
55+ stream_set_read_buffer ($ stream , 0 );
5756 }
5857
5958 if ($ buffer === null ) {
6059 $ buffer = new Buffer ($ stream , $ loop );
6160 }
6261
62+ $ this ->stream = $ stream ;
6363 $ this ->loop = $ loop ;
6464 $ this ->buffer = $ buffer ;
6565
0 commit comments