File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -21,15 +21,13 @@ public function __construct($stream, LoopInterface $loop)
2121 $ this ->loop = $ loop ;
2222 $ this ->buffer = new Buffer ($ this ->stream , $ this ->loop );
2323
24- $ that = $ this ;
25-
26- $ this ->buffer ->on ('error ' , function ($ error ) use ($ that ) {
27- $ that ->emit ('error ' , array ($ error , $ that ));
28- $ that ->close ();
24+ $ this ->buffer ->on ('error ' , function ($ error ) {
25+ $ this ->emit ('error ' , array ($ error , $ this ));
26+ $ this ->close ();
2927 });
3028
31- $ this ->buffer ->on ('drain ' , function () use ( $ that ) {
32- $ that ->emit ('drain ' );
29+ $ this ->buffer ->on ('drain ' , function () {
30+ $ this ->emit ('drain ' );
3331 });
3432
3533 $ this ->resume ();
@@ -95,10 +93,8 @@ public function end($data = null)
9593 $ this ->readable = false ;
9694 $ this ->writable = false ;
9795
98- $ that = $ this ;
99-
100- $ this ->buffer ->on ('close ' , function () use ($ that ) {
101- $ that ->close ();
96+ $ this ->buffer ->on ('close ' , function () {
97+ $ this ->close ();
10298 });
10399
104100 $ this ->buffer ->end ($ data );
You can’t perform that action at this time.
0 commit comments