This repository was archived by the owner on Nov 15, 2022. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -75,7 +75,9 @@ public function write($data = null)
7575 $ this ->createStream ();
7676 }
7777
78- $ this ->doWrite ($ data );
78+ if ($ data !== null ) {
79+ $ this ->doWrite ($ data );
80+ }
7981 }
8082
8183 /**
@@ -85,9 +87,9 @@ abstract public function isSuccess();
8587
8688 /**
8789 * Perform write to socket
88- * @param mixed|null $data
90+ * @param mixed $data
8991 */
90- abstract protected function doWrite ($ data = null );
92+ abstract protected function doWrite ($ data );
9193
9294 /**
9395 * Create the resource stream
Original file line number Diff line number Diff line change @@ -37,8 +37,8 @@ protected function createStream()
3737 /**
3838 * {@inheritdoc}
3939 */
40- protected function doWrite ($ data = null )
40+ protected function doWrite ($ data )
4141 {
42- $ this ->result = false !== @fwrite ($ this ->stream , $ data );
42+ $ this ->result = false !== @fwrite ($ this ->stream , " $ data\n" );
4343 }
4444}
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ protected function createStream()
3434 /**
3535 * {@inheritdoc}
3636 */
37- protected function doWrite ($ data = null )
37+ protected function doWrite ($ data )
3838 {
3939 @stream_socket_sendto ($ this ->stream , $ data );
4040 }
You can’t perform that action at this time.
0 commit comments