@@ -15,8 +15,8 @@ public function __construct(ReadableStreamInterface $readable, WritableStreamInt
1515 $ this ->readable = $ readable ;
1616 $ this ->writable = $ writable ;
1717
18- $ this -> forwardEvents ($ this ->readable , array ('data ' , 'end ' , 'error ' , 'close ' ));
19- $ this -> forwardEvents ($ this ->writable , array ('drain ' , 'error ' , 'close ' , 'pipe ' ));
18+ Util:: forwardEvents ($ this ->readable , $ this , array ('data ' , 'end ' , 'error ' , 'close ' ));
19+ Util:: forwardEvents ($ this ->writable , $ this , array ('drain ' , 'error ' , 'close ' , 'pipe ' ));
2020
2121 $ this ->readable ->on ('close ' , array ($ this , 'close ' ));
2222 $ this ->writable ->on ('close ' , array ($ this , 'close ' ));
@@ -81,15 +81,4 @@ public function close()
8181 $ this ->readable ->close ();
8282 $ this ->writable ->close ();
8383 }
84-
85- protected function forwardEvents ($ stream , array $ events )
86- {
87- $ that = $ this ;
88-
89- foreach ($ events as $ event ) {
90- $ stream ->on ($ event , function () use ($ event , $ that ) {
91- $ that ->emit ($ event , func_get_args ());
92- });
93- }
94- }
95- }
84+ }
0 commit comments