@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | |
| 69 | 69 | $closed = $this->closed(); |
| 70 | 70 | |
| 71 | - $closed->then(function () { |
|
| 71 | + $closed->then(function() { |
|
| 72 | 72 | $this->consumer && $this->consumer->close(); |
| 73 | 73 | }); |
| 74 | 74 | |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | */ |
| 89 | 89 | private function acknowledge() : Promised |
| 90 | 90 | { |
| 91 | - ($this->acknowledge = Promise::deferred())->then(function () { |
|
| 91 | + ($this->acknowledge = Promise::deferred())->then(function() { |
|
| 92 | 92 | unset($this->acknowledge); |
| 93 | 93 | }); |
| 94 | 94 | return $this->acknowledge; |
@@ -110,20 +110,20 @@ discard block |
||
| 110 | 110 | */ |
| 111 | 111 | public function connect() : Promised |
| 112 | 112 | { |
| 113 | - $this->link->on('close', function () { |
|
| 113 | + $this->link->on('close', function() { |
|
| 114 | 114 | unset($this->link); |
| 115 | 115 | $this->closed()->resolve(); |
| 116 | 116 | }); |
| 117 | 117 | |
| 118 | - $this->link->on('message', function (SWRedis $c, array $recv) { |
|
| 118 | + $this->link->on('message', function(SWRedis $c, array $recv) { |
|
| 119 | 119 | $this->messaging($recv); |
| 120 | 120 | }); |
| 121 | 121 | |
| 122 | - return new Promise(function (Promised $promise) { |
|
| 122 | + return new Promise(function(Promised $promise) { |
|
| 123 | 123 | $executed = $this->link->connect( |
| 124 | 124 | $this->host, |
| 125 | 125 | $this->port, |
| 126 | - static function (SWRedis $c, bool $success) use ($promise) { |
|
| 126 | + static function(SWRedis $c, bool $success) use ($promise) { |
|
| 127 | 127 | $success |
| 128 | 128 | ? $promise->resolve() |
| 129 | 129 | : $promise->throw(new ConnectingException($c->errMsg, $c->errCode)) |
@@ -141,8 +141,8 @@ discard block |
||
| 141 | 141 | */ |
| 142 | 142 | public function heartbeat() : Promised |
| 143 | 143 | { |
| 144 | - return new Promise(function (Promised $promised) { |
|
| 145 | - $this->link->__call('ping', [function (SWRedis $c, $result) use ($promised) { |
|
| 144 | + return new Promise(function(Promised $promised) { |
|
| 145 | + $this->link->__call('ping', [function(SWRedis $c, $result) use ($promised) { |
|
| 146 | 146 | $result === false |
| 147 | 147 | ? $promised->reject() |
| 148 | 148 | : $promised->resolve() |
@@ -179,12 +179,12 @@ discard block |
||
| 179 | 179 | EXT::REMOTE_ENDPOINT => new Endpoint($this->named), |
| 180 | 180 | ]); |
| 181 | 181 | |
| 182 | - $executor = function ($fn) use ($name, $arguments) { |
|
| 182 | + $executor = function($fn) use ($name, $arguments) { |
|
| 183 | 183 | array_push($arguments, $fn); |
| 184 | 184 | $this->command($name, $arguments); |
| 185 | 185 | }; |
| 186 | 186 | |
| 187 | - $receiver = static function (SWRedis $c, $result) { |
|
| 187 | + $receiver = static function(SWRedis $c, $result) { |
|
| 188 | 188 | if ($result === false && $c->errCode > 0) { |
| 189 | 189 | throw new CommandException($c->errMsg, $c->errCode); |
| 190 | 190 | } else { |
@@ -83,7 +83,7 @@ |
||
| 83 | 83 | $dsn->option('execute', $this->timeout) |
| 84 | 84 | ); |
| 85 | 85 | |
| 86 | - return new Pool($this->options($endpoint), static function () use ($timeouts, $dsn, $vid) { |
|
| 86 | + return new Pool($this->options($endpoint), static function() use ($timeouts, $dsn, $vid) { |
|
| 87 | 87 | return new Redis( |
| 88 | 88 | sprintf('%s:%d', $dsn->host(), $dsn->port()), |
| 89 | 89 | $dsn->pass() ?: null, |