File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -186,6 +186,12 @@ public function write(
186186 $ length = $ bufferLength ;
187187 }
188188
189+ if ($ length == 0 ) {
190+ $ strand ->send ();
191+
192+ return ;
193+ }
194+
189195 $ done = null ;
190196 $ done = $ this ->streamQueue ->write (
191197 $ stream ,
@@ -197,7 +203,9 @@ function ($stream) use (
197203 ) {
198204 $ bytes = @\fwrite ($ stream , $ buffer , $ length );
199205
200- if ($ bytes === false ) {
206+ // zero and false both indicate an error
207+ // http://php.net/manual/en/function.fwrite.php#96951
208+ if ($ bytes === 0 || $ bytes === false ) {
201209 // @codeCoverageIgnoreStart
202210 $ done ();
203211 $ error = \error_get_last ();
Original file line number Diff line number Diff line change 55namespace Recoil \React ;
66
77use Eloquent \Phony \Phony ;
8- use React \EventLoop \Factory ;
98use React \EventLoop \LoopInterface ;
109use Recoil \Kernel \Api ;
1110use Throwable ;
2221 });
2322
2423 describe ('::create() ' , function () {
25- it ('can be called without a loop ' , function () {
24+ it ('can be called without a loop ' , function () {
2625 $ kernel = ReactKernel::create ();
2726 expect ($ kernel )->to ->be ->an ->instanceof (ReactKernel::class);
2827 });
You can’t perform that action at this time.
0 commit comments