This repository was archived by the owner on Nov 15, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +8
-6
lines changed Expand file tree Collapse file tree 3 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -75,7 +75,9 @@ public function write($data = null)
75
75
$ this ->createStream ();
76
76
}
77
77
78
- $ this ->doWrite ($ data );
78
+ if ($ data !== null ) {
79
+ $ this ->doWrite ($ data );
80
+ }
79
81
}
80
82
81
83
/**
@@ -85,9 +87,9 @@ abstract public function isSuccess();
85
87
86
88
/**
87
89
* Perform write to socket
88
- * @param mixed|null $data
90
+ * @param mixed $data
89
91
*/
90
- abstract protected function doWrite ($ data = null );
92
+ abstract protected function doWrite ($ data );
91
93
92
94
/**
93
95
* Create the resource stream
Original file line number Diff line number Diff line change @@ -37,8 +37,8 @@ protected function createStream()
37
37
/**
38
38
* {@inheritdoc}
39
39
*/
40
- protected function doWrite ($ data = null )
40
+ protected function doWrite ($ data )
41
41
{
42
- $ this ->result = false !== @fwrite ($ this ->stream , $ data );
42
+ $ this ->result = false !== @fwrite ($ this ->stream , " $ data\n" );
43
43
}
44
44
}
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ protected function createStream()
34
34
/**
35
35
* {@inheritdoc}
36
36
*/
37
- protected function doWrite ($ data = null )
37
+ protected function doWrite ($ data )
38
38
{
39
39
@stream_socket_sendto ($ this ->stream , $ data );
40
40
}
You can’t perform that action at this time.
0 commit comments