Completed
Push — master ( 9d82d2...fc8545 )
by Kamil
36:08 queued 02:13
created
src/MySQL/Command/Concrete/QueryCommand.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
 
25 25
     public function setQuery($query)
26 26
     {
27
-        if (! $query instanceof Query)
27
+        if (!$query instanceof Query)
28 28
         {
29 29
             $query = new Query($query);
30 30
         }
Please login to merge, or discard this patch.
src/MySQL/Query.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
     public function bindParams()
51 51
     {
52 52
         $this->sqlPrepared = null;
53
-        $this->params   = func_get_args();
53
+        $this->params = func_get_args();
54 54
 
55 55
         return $this;
56 56
     }
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
     public function bindParamsFromArray(array $params)
59 59
     {
60 60
         $this->sqlPrepared = null;
61
-        $this->params   = $params;
61
+        $this->params = $params;
62 62
 
63 63
         return $this;
64 64
     }
Please login to merge, or discard this patch.
src/MySQL/Protocol/ProtocolParser.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -94,8 +94,8 @@  discard block
 block discarded – undo
94 94
 
95 95
     public function start()
96 96
     {
97
-        $this->stream->on('data', [ $this, 'handleData' ]);
98
-        $this->stream->on('close', [ $this, 'handleClose' ]);
97
+        $this->stream->on('data', [$this, 'handleData']);
98
+        $this->stream->on('close', [$this, 'handleClose']);
99 99
     }
100 100
 
101 101
     public function handleNewCommand()
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
                 }
257 257
                 else
258 258
                 {
259
-                    ++ $this->rsState;
259
+                    ++$this->rsState;
260 260
                 }
261 261
             }
262 262
             //Data packet
@@ -409,13 +409,13 @@  discard block
 block discarded – undo
409 409
 
410 410
     public function restBuffer($len)
411 411
     {
412
-        if(strlen($this->buffer) === ($this->bufferPos+$len))
412
+        if (strlen($this->buffer) === ($this->bufferPos + $len))
413 413
         {
414 414
             $this->buffer = '';
415 415
         }
416 416
         else
417 417
         {
418
-            $this->buffer = substr($this->buffer,$this->bufferPos+$len);
418
+            $this->buffer = substr($this->buffer, $this->bufferPos + $len);
419 419
         }
420 420
         $this->bufferPos = 0;
421 421
     }
Please login to merge, or discard this patch.
src/MySQL/Database.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -105,12 +105,12 @@  discard block
 block discarded – undo
105 105
             $options = $this->config;
106 106
             $streamRef = $this->stream;
107 107
 
108
-            $errorHandler = function ($reason) use ($reject) {
108
+            $errorHandler = function($reason) use ($reject) {
109 109
                 $this->state = self::STATE_AUTH_FAILED;
110 110
                 return $reject($reason);
111 111
             };
112 112
 
113
-            $connectedHandler = function ($serverOptions) use ($resolve) {
113
+            $connectedHandler = function($serverOptions) use ($resolve) {
114 114
                 $this->state = self::STATE_AUTH_SUCCEEDED;
115 115
                 $this->serverOptions = $serverOptions;
116 116
                 return $resolve($serverOptions);
@@ -118,11 +118,11 @@  discard block
 block discarded – undo
118 118
 
119 119
             $this
120 120
                 ->connect()
121
-                ->then(function ($stream) use (&$streamRef, $options, $errorHandler, $connectedHandler) {
121
+                ->then(function($stream) use (&$streamRef, $options, $errorHandler, $connectedHandler) {
122 122
                     $streamRef = $stream;
123 123
 
124
-                    $stream->on('error', [ $this, 'handleConnectionError' ]);
125
-                    $stream->on('close', [ $this, 'handleConnectionClosed' ]);
124
+                    $stream->on('error', [$this, 'handleConnectionError']);
125
+                    $stream->on('close', [$this, 'handleConnectionClosed']);
126 126
 
127 127
                     $parser = $this->parser = new ProtocolParser($stream, $this->executor);
128 128
 
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
                     //$parser->on('close', $closeHandler);
136 136
                     $parser->start();
137 137
 
138
-                }, [ $this, 'handleConnectionError' ]);
138
+                }, [$this, 'handleConnectionError']);
139 139
         });
140 140
     }
141 141
 
@@ -150,8 +150,8 @@  discard block
 block discarded – undo
150 150
                 ->doCommand(new QuitCommand($this))
151 151
                 ->on('success', function() use($resolve) {
152 152
                     $this->state = self::STATE_STOPPED;
153
-                    $this->emit('end', [ $this ]);
154
-                    $this->emit('close', [ $this ]);
153
+                    $this->emit('end', [$this]);
154
+                    $this->emit('close', [$this]);
155 155
                     $resolve($this);
156 156
                 });
157 157
             $this->state = self::STATE_CLOSEING;
@@ -175,15 +175,15 @@  discard block
 block discarded – undo
175 175
         $query->bindParamsFromArray($sqlParams);
176 176
         $this->doCommand($command);
177 177
 
178
-        $command->on('results', function ($rows, $command) use ($promise) {
178
+        $command->on('results', function($rows, $command) use ($promise) {
179 179
             return $command->hasError()
180 180
                 ? $promise->reject($command->getError())
181 181
                 : $promise->resolve($command);
182 182
         });
183
-        $command->on('error', function ($err, $command) use ($promise) {
183
+        $command->on('error', function($err, $command) use ($promise) {
184 184
             return $promise->reject($err);
185 185
         });
186
-        $command->on('success', function ($command) use ($promise) {
186
+        $command->on('success', function($command) use ($promise) {
187 187
             return $command->hasError()
188 188
                 ? $promise->reject($command->getError())
189 189
                 : $promise->resolve($command);
@@ -197,10 +197,10 @@  discard block
 block discarded – undo
197 197
         $promise = new Promise();
198 198
 
199 199
         $this->doCommand(new PingCommand($this))
200
-            ->on('error', function ($reason) use ($promise) {
200
+            ->on('error', function($reason) use ($promise) {
201 201
                 return $promise->reject($reason);
202 202
             })
203
-            ->on('success', function () use ($promise) {
203
+            ->on('success', function() use ($promise) {
204 204
                 return $promise->resolve();
205 205
             });
206 206
     }
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
 
235 235
     public function handleConnectionError($err)
236 236
     {
237
-        $this->emit('error', [ $err, $this ]);
237
+        $this->emit('error', [$err, $this]);
238 238
     }
239 239
 
240 240
     public function handleConnectionClosed()
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
         if ($this->state < self::STATE_CLOSEING)
243 243
         {
244 244
             $this->state = self::STATE_STOPPED;
245
-            $this->emit('error', [ new RuntimeException('mysql server has gone away'), $this ]);
245
+            $this->emit('error', [new RuntimeException('mysql server has gone away'), $this]);
246 246
         }
247 247
     }
248 248
 
Please login to merge, or discard this patch.