Passed
Pull Request — master (#297)
by
unknown
07:59
created
src/Statements/InsertStatement.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -113,15 +113,15 @@
 block discarded – undo
113 113
         $ret = 'INSERT ' . $this->options;
114 114
         $ret = trim($ret) . ' INTO ' . $this->into;
115 115
 
116
-        if (! is_null($this->values) && count($this->values) > 0) {
116
+        if (!is_null($this->values) && count($this->values) > 0) {
117 117
             $ret .= ' VALUES ' . Array2d::build($this->values);
118
-        } elseif (! is_null($this->set) && count($this->set) > 0) {
118
+        } elseif (!is_null($this->set) && count($this->set) > 0) {
119 119
             $ret .= ' SET ' . SetOperation::build($this->set);
120
-        } elseif (! is_null($this->select) && strlen($this->select) > 0) {
120
+        } elseif (!is_null($this->select) && strlen($this->select) > 0) {
121 121
             $ret .= ' ' . $this->select->build();
122 122
         }
123 123
 
124
-        if (! is_null($this->onDuplicateSet) && count($this->onDuplicateSet) > 0) {
124
+        if (!is_null($this->onDuplicateSet) && count($this->onDuplicateSet) > 0) {
125 125
             $ret .= ' ON DUPLICATE KEY UPDATE ' . SetOperation::build($this->onDuplicateSet);
126 126
         }
127 127
 
Please login to merge, or discard this patch.
src/Statements/SelectStatement.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -331,7 +331,7 @@
 block discarded – undo
331 331
         // This is a cheap fix for `SELECT` statements that contain `UNION`.
332 332
         // The `ORDER BY` and `LIMIT` clauses should be at the end of the
333 333
         // statement.
334
-        if (! empty($this->union)) {
334
+        if (!empty($this->union)) {
335 335
             $clauses = static::$CLAUSES;
336 336
             unset($clauses['ORDER BY'], $clauses['LIMIT']);
337 337
             $clauses['ORDER BY'] = array(
Please login to merge, or discard this patch.
src/Statements/ReplaceStatement.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -90,11 +90,11 @@
 block discarded – undo
90 90
         $ret = 'REPLACE ' . $this->options;
91 91
         $ret = trim($ret) . ' INTO ' . $this->into;
92 92
 
93
-        if (! is_null($this->values) && count($this->values) > 0) {
93
+        if (!is_null($this->values) && count($this->values) > 0) {
94 94
             $ret .= ' VALUES ' . Array2d::build($this->values);
95
-        } elseif (! is_null($this->set) && count($this->set) > 0) {
95
+        } elseif (!is_null($this->set) && count($this->set) > 0) {
96 96
             $ret .= ' SET ' . SetOperation::build($this->set);
97
-        } elseif (! is_null($this->select) && strlen($this->select) > 0) {
97
+        } elseif (!is_null($this->select) && strlen($this->select) > 0) {
98 98
             $ret .= ' ' . $this->select->build();
99 99
         }
100 100
 
Please login to merge, or discard this patch.
src/Token.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
         switch ($this->type) {
243 243
             case self::TYPE_KEYWORD:
244 244
                 $this->keyword = strtoupper($this->token);
245
-                if (! ($this->flags & self::FLAG_KEYWORD_RESERVED)) {
245
+                if (!($this->flags & self::FLAG_KEYWORD_RESERVED)) {
246 246
                     // Unreserved keywords should stay the way they are because they
247 247
                     // might represent field names.
248 248
                     return $this->token;
@@ -266,7 +266,7 @@  discard block
 block discarded – undo
266 266
                 || ($this->flags & self::FLAG_NUMBER_FLOAT)
267 267
                 ) {
268 268
                     $ret = (float) $ret;
269
-                } elseif (! ($this->flags & self::FLAG_NUMBER_BINARY)) {
269
+                } elseif (!($this->flags & self::FLAG_NUMBER_BINARY)) {
270 270
                     $ret = (int) $ret;
271 271
                 }
272 272
 
@@ -299,7 +299,7 @@  discard block
 block discarded – undo
299 299
                     // in PHP 5.3- the `null` parameter isn't handled correctly.
300 300
                     $str = mb_substr(
301 301
                         $str,
302
-                        (! empty($str[1]) && ($str[1] === '@')) ? 2 : 1,
302
+                        (!empty($str[1]) && ($str[1] === '@')) ? 2 : 1,
303 303
                         mb_strlen($str),
304 304
                         'UTF-8'
305 305
                     );
Please login to merge, or discard this patch.
src/Components/AlterOperation.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -271,11 +271,11 @@  discard block
 block discarded – undo
271 271
                     } elseif (($token->value === ',') && ($brackets === 0)) {
272 272
                         break;
273 273
                     }
274
-                } elseif (! empty(Parser::$STATEMENT_PARSERS[$token->value])) {
274
+                } elseif (!empty(Parser::$STATEMENT_PARSERS[$token->value])) {
275 275
                     // We have reached the end of ALTER operation and suddenly found
276 276
                     // a start to new statement, but have not find a delimiter between them
277 277
 
278
-                    if (! ($token->value === 'SET' && $list->tokens[$list->idx - 1]->value === 'CHARACTER')) {
278
+                    if (!($token->value === 'SET' && $list->tokens[$list->idx - 1]->value === 'CHARACTER')) {
279 279
                         $parser->error(
280 280
                             'A new statement was found, but no delimiter between it and the previous one.',
281 281
                             $token
@@ -284,7 +284,7 @@  discard block
 block discarded – undo
284 284
                     }
285 285
                 } elseif ((array_key_exists($token->value, self::$DB_OPTIONS)
286 286
                     || array_key_exists($token->value, self::$TABLE_OPTIONS))
287
-                    && ! self::checkIfColumnDefinitionKeyword($token->value)
287
+                    && !self::checkIfColumnDefinitionKeyword($token->value)
288 288
                 ) {
289 289
                     // This alter operation has finished, which means a comma was missing before start of new alter operation
290 290
                     $parser->error(
Please login to merge, or discard this patch.
src/Components/IntoKeyword.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -272,7 +272,7 @@
 block discarded – undo
272 272
     public static function build($component, array $options = array())
273 273
     {
274 274
         if ($component->dest instanceof Expression) {
275
-            $columns = ! empty($component->columns) ? '(`' . implode('`, `', $component->columns) . '`)' : '';
275
+            $columns = !empty($component->columns) ? '(`' . implode('`, `', $component->columns) . '`)' : '';
276 276
 
277 277
             return $component->dest . $columns;
278 278
         } elseif (isset($component->values)) {
Please login to merge, or discard this patch.
src/Components/RenameOperation.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -156,7 +156,7 @@
 block discarded – undo
156 156
         }
157 157
 
158 158
         // Last iteration was not saved.
159
-        if (! empty($expr->old)) {
159
+        if (!empty($expr->old)) {
160 160
             $ret[] = $expr;
161 161
         }
162 162
 
Please login to merge, or discard this patch.
src/Components/Key.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
                         $state = 3;
163 163
                     } elseif (($token->value === ',') || ($token->value === ')')) {
164 164
                         $state = ($token->value === ',') ? 2 : 4;
165
-                        if (! empty($lastColumn)) {
165
+                        if (!empty($lastColumn)) {
166 166
                             $ret->columns[] = $lastColumn;
167 167
                             $lastColumn = array();
168 168
                         }
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
     public static function build($component, array $options = array())
198 198
     {
199 199
         $ret = $component->type . ' ';
200
-        if (! empty($component->name)) {
200
+        if (!empty($component->name)) {
201 201
             $ret .= Context::escape($component->name) . ' ';
202 202
         }
203 203
 
Please login to merge, or discard this patch.
src/Components/Expression.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
         );
199 199
 
200 200
         // When a field is parsed, no parentheses are expected.
201
-        if (! empty($options['parseField'])) {
201
+        if (!empty($options['parseField'])) {
202 202
             $options['breakOnParentheses'] = true;
203 203
             $options['field'] = $options['parseField'];
204 204
         }
@@ -228,14 +228,14 @@  discard block
 block discarded – undo
228 228
 
229 229
             if ($token->type === Token::TYPE_KEYWORD) {
230 230
                 if (($brackets > 0) && empty($ret->subquery)
231
-                    && ! empty(Parser::$STATEMENT_PARSERS[$token->keyword])
231
+                    && !empty(Parser::$STATEMENT_PARSERS[$token->keyword])
232 232
                 ) {
233 233
                     // A `(` was previously found and this keyword is the
234 234
                     // beginning of a statement, so this is a subquery.
235 235
                     $ret->subquery = $token->keyword;
236 236
                 } elseif (($token->flags & Token::FLAG_KEYWORD_FUNCTION)
237 237
                     && (empty($options['parseField'])
238
-                    && ! $alias)
238
+                    && !$alias)
239 239
                 ) {
240 240
                     $isExpr = true;
241 241
                 } elseif (($token->flags & Token::FLAG_KEYWORD_RESERVED)
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
                         break;
249 249
                     }
250 250
                     if ($token->keyword === 'AS') {
251
-                        if (! empty($options['breakOnAlias'])) {
251
+                        if (!empty($options['breakOnAlias'])) {
252 252
                             break;
253 253
                         }
254 254
                         if ($alias) {
@@ -269,7 +269,7 @@  discard block
 block discarded – undo
269 269
                         continue;
270 270
                     }
271 271
                     $isExpr = true;
272
-                } elseif ($brackets === 0 && strlen($ret->expr) > 0 && ! $alias) {
272
+                } elseif ($brackets === 0 && strlen($ret->expr) > 0 && !$alias) {
273 273
                     /* End of expression */
274 274
                     break;
275 275
                 }
@@ -284,7 +284,7 @@  discard block
 block discarded – undo
284 284
                 || (($token->type === Token::TYPE_OPERATOR)
285 285
                 && ($token->value !== '.'))
286 286
             ) {
287
-                if (! empty($options['parseField'])) {
287
+                if (!empty($options['parseField'])) {
288 288
                     break;
289 289
                 }
290 290
 
@@ -294,7 +294,7 @@  discard block
 block discarded – undo
294 294
             }
295 295
 
296 296
             if ($token->type === Token::TYPE_OPERATOR) {
297
-                if (! empty($options['breakOnParentheses'])
297
+                if (!empty($options['breakOnParentheses'])
298 298
                     && (($token->value === '(') || ($token->value === ')'))
299 299
                 ) {
300 300
                     // No brackets were expected.
@@ -317,7 +317,7 @@  discard block
 block discarded – undo
317 317
                     } else {
318 318
                         --$brackets;
319 319
                         if ($brackets === 0) {
320
-                            if (! empty($options['parenthesesDelimited'])) {
320
+                            if (!empty($options['parenthesesDelimited'])) {
321 321
                                 // The current token is the last bracket, the next
322 322
                                 // one will be outside the expression.
323 323
                                 $ret->expr .= $token->token;
@@ -344,7 +344,7 @@  discard block
 block discarded – undo
344 344
 
345 345
             if ($alias) {
346 346
                 // An alias is expected (the keyword `AS` was previously found).
347
-                if (! empty($ret->alias)) {
347
+                if (!empty($ret->alias)) {
348 348
                     $parser->error('An alias was previously found.', $token);
349 349
                     break;
350 350
                 }
@@ -357,13 +357,13 @@  discard block
 block discarded – undo
357 357
                     || ((($prev[0]->type !== Token::TYPE_OPERATOR)
358 358
                     || ($prev[0]->token === ')'))
359 359
                     && (($prev[0]->type !== Token::TYPE_KEYWORD)
360
-                    || (! ($prev[0]->flags & Token::FLAG_KEYWORD_RESERVED)))))
360
+                    || (!($prev[0]->flags & Token::FLAG_KEYWORD_RESERVED)))))
361 361
                     && (($prev[1]->type === Token::TYPE_STRING)
362 362
                     || (($prev[1]->type === Token::TYPE_SYMBOL)
363
-                    && (! ($prev[1]->flags & Token::FLAG_SYMBOL_VARIABLE)))
363
+                    && (!($prev[1]->flags & Token::FLAG_SYMBOL_VARIABLE)))
364 364
                     || ($prev[1]->type === Token::TYPE_NONE))
365 365
                 ) {
366
-                    if (! empty($ret->alias)) {
366
+                    if (!empty($ret->alias)) {
367 367
                         $parser->error('An alias was previously found.', $token);
368 368
                         break;
369 369
                     }
@@ -371,12 +371,12 @@  discard block
 block discarded – undo
371 371
                 } else {
372 372
                     $ret->expr .= $token->token;
373 373
                 }
374
-            } elseif (! $isExpr) {
374
+            } elseif (!$isExpr) {
375 375
                 if (($token->type === Token::TYPE_OPERATOR) && ($token->value === '.')) {
376 376
                     // Found a `.` which means we expect a column name and
377 377
                     // the column name we parsed is actually the table name
378 378
                     // and the table name is actually a database name.
379
-                    if (! empty($ret->database) || $dot) {
379
+                    if (!empty($ret->database) || $dot) {
380 380
                         $parser->error('Unexpected dot.', $token);
381 381
                     }
382 382
                     $ret->database = $ret->table;
@@ -392,10 +392,10 @@  discard block
 block discarded – undo
392 392
                         $dot = false;
393 393
                     } else {
394 394
                         // No alias is expected.
395
-                        if (! empty($options['breakOnAlias'])) {
395
+                        if (!empty($options['breakOnAlias'])) {
396 396
                             break;
397 397
                         }
398
-                        if (! empty($ret->alias)) {
398
+                        if (!empty($ret->alias)) {
399 399
                             $parser->error('An alias was previously found.', $token);
400 400
                             break;
401 401
                         }
@@ -436,7 +436,7 @@  discard block
 block discarded – undo
436 436
             return implode(', ', $component);
437 437
         }
438 438
 
439
-        if ($component->expr !== '' && ! is_null($component->expr)) {
439
+        if ($component->expr !== '' && !is_null($component->expr)) {
440 440
             $ret = $component->expr;
441 441
         } else {
442 442
             $fields = array();
@@ -452,7 +452,7 @@  discard block
 block discarded – undo
452 452
             $ret = implode('.', Context::escape($fields));
453 453
         }
454 454
 
455
-        if (! empty($component->alias)) {
455
+        if (!empty($component->alias)) {
456 456
             $ret .= ' AS ' . Context::escape($component->alias);
457 457
         }
458 458
 
Please login to merge, or discard this patch.