@@ -57,14 +57,14 @@ discard block |
||
| 57 | 57 | $this->uxdomain ? SWOOLE_SOCK_UNIX_DGRAM : SWOOLE_SOCK_UDP, |
| 58 | 58 | ($async = PHP_SAPI === 'cli') ? SWOOLE_SOCK_ASYNC : SWOOLE_SOCK_SYNC |
| 59 | 59 | ); |
| 60 | - $async && $this->client->on('connect', static function () { |
|
| 60 | + $async && $this->client->on('connect', static function() { |
|
| 61 | 61 | // do nothing |
| 62 | 62 | }); |
| 63 | - $async && $this->client->on('receive', static function () { |
|
| 63 | + $async && $this->client->on('receive', static function() { |
|
| 64 | 64 | // do nothing |
| 65 | 65 | }); |
| 66 | 66 | $this->client->connect($this->endpoint->host(), $this->endpoint->port()); |
| 67 | - $this->sender = function (string $data) { |
|
| 67 | + $this->sender = function(string $data) { |
|
| 68 | 68 | @$this->client->send($data); |
| 69 | 69 | }; |
| 70 | 70 | } |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | SOCK_DGRAM, |
| 79 | 79 | $this->uxdomain ? IPPROTO_IP : SOL_UDP |
| 80 | 80 | ); |
| 81 | - $this->sender = function (string $data) { |
|
| 81 | + $this->sender = function(string $data) { |
|
| 82 | 82 | @socket_sendto( |
| 83 | 83 | $this->socket, |
| 84 | 84 | $data, |
@@ -155,10 +155,10 @@ discard block |
||
| 155 | 155 | private function packing(string $payload) : string |
| 156 | 156 | { |
| 157 | 157 | return |
| 158 | - self::MAGIC . |
|
| 159 | - pack('N', strlen($this->identify)) . |
|
| 160 | - $this->identify . |
|
| 161 | - pack('N', strlen($payload)) . |
|
| 158 | + self::MAGIC. |
|
| 159 | + pack('N', strlen($this->identify)). |
|
| 160 | + $this->identify. |
|
| 161 | + pack('N', strlen($payload)). |
|
| 162 | 162 | $payload |
| 163 | 163 | ; |
| 164 | 164 | } |