Passed
Pull Request — master (#311)
by William
12:43
created
src/Components/PartitionDefinition.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -247,7 +247,7 @@
 block discarded – undo
247 247
         return trim(
248 248
             'PARTITION ' . $component->name
249 249
             . (empty($component->type) ? '' : ' VALUES ' . $component->type . ' ' . $component->expr . ' ')
250
-            . ((! empty($component->options) && ! empty($component->type)) ? '' : ' ') . $component->options . $subpartitions
250
+            . ((!empty($component->options) && !empty($component->type)) ? '' : ' ') . $component->options . $subpartitions
251 251
         );
252 252
     }
253 253
 }
Please login to merge, or discard this patch.
src/Components/Condition.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
                 } else {
155 155
                     // The expression ended.
156 156
                     $expr->expr = trim($expr->expr);
157
-                    if (! empty($expr->expr)) {
157
+                    if (!empty($expr->expr)) {
158 158
                         $ret[] = $expr;
159 159
                     }
160 160
 
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
 
172 172
             if (($token->type === Token::TYPE_KEYWORD)
173 173
                 && ($token->flags & Token::FLAG_KEYWORD_RESERVED)
174
-                && ! ($token->flags & Token::FLAG_KEYWORD_FUNCTION)
174
+                && !($token->flags & Token::FLAG_KEYWORD_FUNCTION)
175 175
             ) {
176 176
                 if ($token->value === 'BETWEEN') {
177 177
                     $betweenBefore = true;
@@ -195,11 +195,11 @@  discard block
 block discarded – undo
195 195
             $expr->expr .= $token->token;
196 196
             if (($token->type === Token::TYPE_NONE)
197 197
                 || (($token->type === Token::TYPE_KEYWORD)
198
-                && (! ($token->flags & Token::FLAG_KEYWORD_RESERVED)))
198
+                && (!($token->flags & Token::FLAG_KEYWORD_RESERVED)))
199 199
                 || ($token->type === Token::TYPE_STRING)
200 200
                 || ($token->type === Token::TYPE_SYMBOL)
201 201
             ) {
202
-                if (! in_array($token->value, $expr->identifiers)) {
202
+                if (!in_array($token->value, $expr->identifiers)) {
203 203
                     $expr->identifiers[] = $token->value;
204 204
                 }
205 205
             }
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
 
208 208
         // Last iteration was not processed.
209 209
         $expr->expr = trim($expr->expr);
210
-        if (! empty($expr->expr)) {
210
+        if (!empty($expr->expr)) {
211 211
             $ret[] = $expr;
212 212
         }
213 213
 
Please login to merge, or discard this patch.
src/Components/JoinKeyword.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
 
152 152
             if ($state === 0) {
153 153
                 if (($token->type === Token::TYPE_KEYWORD)
154
-                    && ! empty(static::$JOINS[$token->keyword])
154
+                    && !empty(static::$JOINS[$token->keyword])
155 155
                 ) {
156 156
                     $expr->type = static::$JOINS[$token->keyword];
157 157
                     $state = 1;
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
                             $state = 4;
172 172
                             break;
173 173
                         default:
174
-                            if (! empty(static::$JOINS[$token->keyword])
174
+                            if (!empty(static::$JOINS[$token->keyword])
175 175
                             ) {
176 176
                                 $ret[] = $expr;
177 177
                                 $expr = new self();
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
             }
198 198
         }
199 199
 
200
-        if (! empty($expr->type)) {
200
+        if (!empty($expr->type)) {
201 201
             $ret[] = $expr;
202 202
         }
203 203
 
@@ -217,9 +217,9 @@  discard block
 block discarded – undo
217 217
         $ret = array();
218 218
         foreach ($component as $c) {
219 219
             $ret[] = array_search($c->type, static::$JOINS) . ' ' . $c->expr
220
-                . (! empty($c->on)
220
+                . (!empty($c->on)
221 221
                     ? ' ON ' . Condition::build($c->on) : '')
222
-                . (! empty($c->using)
222
+                . (!empty($c->using)
223 223
                     ? ' USING ' . ArrayObj::build($c->using) : '');
224 224
         }
225 225
 
Please login to merge, or discard this patch.
src/Utils/Tokens.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
         $isList = $list instanceof TokensList;
77 77
 
78 78
         // Parsing the tokens.
79
-        if (! $isList) {
79
+        if (!$isList) {
80 80
             $list = Lexer::getTokens($list);
81 81
         }
82 82
 
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
                     ++$j;
137 137
                 }
138 138
 
139
-                if (! static::match($list->tokens[$j], $find[$k])) {
139
+                if (!static::match($list->tokens[$j], $find[$k])) {
140 140
                     // This token does not match the pattern.
141 141
                     break;
142 142
                 }
Please login to merge, or discard this patch.
src/Utils/Formatter.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -258,12 +258,12 @@  discard block
 block discarded – undo
258 258
         /* Sanitize the array so that we do not have to care later */
259 259
         foreach ($newFormats as $j => $new) {
260 260
             foreach ($integers as $name) {
261
-                if (! isset($new[$name])) {
261
+                if (!isset($new[$name])) {
262 262
                     $newFormats[$j][$name] = 0;
263 263
                 }
264 264
             }
265 265
             foreach ($strings as $name) {
266
-                if (! isset($new[$name])) {
266
+                if (!isset($new[$name])) {
267 267
                     $newFormats[$j][$name] = '';
268 268
                 }
269 269
             }
@@ -283,7 +283,7 @@  discard block
 block discarded – undo
283 283
 
284 284
         /* Add not already handled formats */
285 285
         foreach ($newFormats as $j => $new) {
286
-            if (! in_array($j, $added)) {
286
+            if (!in_array($j, $added)) {
287 287
                 $formats[] = $new;
288 288
             }
289 289
         }
@@ -410,7 +410,7 @@  discard block
 block discarded – undo
410 410
 
411 411
                 // The options of a clause should stay on the same line and everything that follows.
412 412
                 if ($this->options['parts_newline']
413
-                    && ! $formattedOptions
413
+                    && !$formattedOptions
414 414
                     && empty(self::$INLINE_CLAUSES[$lastClause])
415 415
                     && (
416 416
                         $curr->type !== Token::TYPE_KEYWORD
@@ -462,7 +462,7 @@  discard block
 block discarded – undo
462 462
                     if (end($blocksLineEndings) === true
463 463
                         || (
464 464
                             empty(self::$INLINE_CLAUSES[$lastClause])
465
-                            && ! $shortGroup
465
+                            && !$shortGroup
466 466
                             && $this->options['parts_newline']
467 467
                         )
468 468
                     ) {
@@ -502,7 +502,7 @@  discard block
 block discarded – undo
502 502
                     // Also, some tokens do not have spaces before or after them.
503 503
                     if (// A space after delimiters that are longer than 2 characters.
504 504
                         $prev->keyword === 'DELIMITER'
505
-                        || ! (
505
+                        || !(
506 506
                             ($prev->type === Token::TYPE_OPERATOR && ($prev->value === '.' || $prev->value === '('))
507 507
                             // No space after . (
508 508
                             || ($curr->type === Token::TYPE_OPERATOR && ($curr->value === '.' || $curr->value === ',' || $curr->value === '(' || $curr->value === ')'))
@@ -618,7 +618,7 @@  discard block
 block discarded – undo
618 618
                 && ($token->flags & $format['flags']) === $format['flags']
619 619
             ) {
620 620
                 // Running transformation function.
621
-                if (! empty($format['function'])) {
621
+                if (!empty($format['function'])) {
622 622
                     $func = $format['function'];
623 623
                     $text = $func($text);
624 624
                 }
Please login to merge, or discard this patch.
src/Utils/Misc.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
      */
29 29
     public static function getAliases($statement, $database)
30 30
     {
31
-        if (! ($statement instanceof SelectStatement)
31
+        if (!($statement instanceof SelectStatement)
32 32
             || empty($statement->expr)
33 33
             || empty($statement->from)
34 34
         ) {
@@ -48,28 +48,28 @@  discard block
 block discarded – undo
48 48
         $expressions = $statement->from;
49 49
 
50 50
         // Adding expressions from JOIN.
51
-        if (! empty($statement->join)) {
51
+        if (!empty($statement->join)) {
52 52
             foreach ($statement->join as $join) {
53 53
                 $expressions[] = $join->expr;
54 54
             }
55 55
         }
56 56
 
57 57
         foreach ($expressions as $expr) {
58
-            if (! isset($expr->table) || ($expr->table === '')) {
58
+            if (!isset($expr->table) || ($expr->table === '')) {
59 59
                 continue;
60 60
             }
61 61
 
62 62
             $thisDb = (isset($expr->database) && ($expr->database !== '')) ?
63 63
                 $expr->database : $database;
64 64
 
65
-            if (! isset($retval[$thisDb])) {
65
+            if (!isset($retval[$thisDb])) {
66 66
                 $retval[$thisDb] = array(
67 67
                     'alias' => null,
68 68
                     'tables' => array()
69 69
                 );
70 70
             }
71 71
 
72
-            if (! isset($retval[$thisDb]['tables'][$expr->table])) {
72
+            if (!isset($retval[$thisDb]['tables'][$expr->table])) {
73 73
                 $retval[$thisDb]['tables'][$expr->table] = array(
74 74
                     'alias' => (isset($expr->alias) && ($expr->alias !== '')) ?
75 75
                         $expr->alias : null,
@@ -77,14 +77,14 @@  discard block
 block discarded – undo
77 77
                 );
78 78
             }
79 79
 
80
-            if (! isset($tables[$thisDb])) {
80
+            if (!isset($tables[$thisDb])) {
81 81
                 $tables[$thisDb] = array();
82 82
             }
83 83
             $tables[$thisDb][$expr->alias] = $expr->table;
84 84
         }
85 85
 
86 86
         foreach ($statement->expr as $expr) {
87
-            if (! isset($expr->column, $expr->alias) || ($expr->column === '') || ($expr->alias === '')
87
+            if (!isset($expr->column, $expr->alias) || ($expr->column === '') || ($expr->alias === '')
88 88
             ) {
89 89
                 continue;
90 90
             }
Please login to merge, or discard this patch.
src/Utils/CLI.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -55,10 +55,10 @@
 block discarded – undo
55 55
             return false;
56 56
         }
57 57
         $this->mergeLongOpts($params, $longopts);
58
-        if (! isset($params['f'])) {
58
+        if (!isset($params['f'])) {
59 59
             $params['f'] = 'cli';
60 60
         }
61
-        if (! in_array($params['f'], array('html', 'cli', 'text'))) {
61
+        if (!in_array($params['f'], array('html', 'cli', 'text'))) {
62 62
             echo "ERROR: Invalid value for format!\n";
63 63
 
64 64
             return false;
Please login to merge, or discard this patch.
src/Utils/Routine.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -118,7 +118,7 @@
 block discarded – undo
118 118
             'opts' => array()
119 119
         );
120 120
 
121
-        if (! empty($statement->parameters)) {
121
+        if (!empty($statement->parameters)) {
122 122
             $idx = 0;
123 123
             foreach ($statement->parameters as $param) {
124 124
                 $retval['dir'][$idx] = $param->inOut;
Please login to merge, or discard this patch.
src/Utils/Query.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
         $flags['querytype'] = 'SELECT';
228 228
         $flags['is_select'] = true;
229 229
 
230
-        if (! empty($statement->from)) {
230
+        if (!empty($statement->from)) {
231 231
             $flags['select_from'] = true;
232 232
         }
233 233
 
@@ -235,55 +235,55 @@  discard block
 block discarded – undo
235 235
             $flags['distinct'] = true;
236 236
         }
237 237
 
238
-        if (! empty($statement->group) || ! empty($statement->having)) {
238
+        if (!empty($statement->group) || !empty($statement->having)) {
239 239
             $flags['is_group'] = true;
240 240
         }
241 241
 
242
-        if (! empty($statement->into)
242
+        if (!empty($statement->into)
243 243
             && ($statement->into->type === 'OUTFILE')
244 244
         ) {
245 245
             $flags['is_export'] = true;
246 246
         }
247 247
 
248 248
         $expressions = $statement->expr;
249
-        if (! empty($statement->join)) {
249
+        if (!empty($statement->join)) {
250 250
             foreach ($statement->join as $join) {
251 251
                 $expressions[] = $join->expr;
252 252
             }
253 253
         }
254 254
 
255 255
         foreach ($expressions as $expr) {
256
-            if (! empty($expr->function)) {
256
+            if (!empty($expr->function)) {
257 257
                 if ($expr->function === 'COUNT') {
258 258
                     $flags['is_count'] = true;
259 259
                 } elseif (in_array($expr->function, static::$FUNCTIONS)) {
260 260
                     $flags['is_func'] = true;
261 261
                 }
262 262
             }
263
-            if (! empty($expr->subquery)) {
263
+            if (!empty($expr->subquery)) {
264 264
                 $flags['is_subquery'] = true;
265 265
             }
266 266
         }
267 267
 
268
-        if (! empty($statement->procedure)
268
+        if (!empty($statement->procedure)
269 269
             && ($statement->procedure->name === 'ANALYSE')
270 270
         ) {
271 271
             $flags['is_analyse'] = true;
272 272
         }
273 273
 
274
-        if (! empty($statement->group)) {
274
+        if (!empty($statement->group)) {
275 275
             $flags['group'] = true;
276 276
         }
277 277
 
278
-        if (! empty($statement->having)) {
278
+        if (!empty($statement->having)) {
279 279
             $flags['having'] = true;
280 280
         }
281 281
 
282
-        if (! empty($statement->union)) {
282
+        if (!empty($statement->union)) {
283 283
             $flags['union'] = true;
284 284
         }
285 285
 
286
-        if (! empty($statement->join)) {
286
+        if (!empty($statement->join)) {
287 287
             $flags['join'] = true;
288 288
         }
289 289
 
@@ -374,10 +374,10 @@  discard block
 block discarded – undo
374 374
             || ($statement instanceof UpdateStatement)
375 375
             || ($statement instanceof DeleteStatement)
376 376
         ) {
377
-            if (! empty($statement->limit)) {
377
+            if (!empty($statement->limit)) {
378 378
                 $flags['limit'] = true;
379 379
             }
380
-            if (! empty($statement->order)) {
380
+            if (!empty($statement->order)) {
381 381
                 $flags['order'] = true;
382 382
             }
383 383
         }
@@ -445,7 +445,7 @@  discard block
 block discarded – undo
445 445
                                 $expr->database : null
446 446
                         );
447 447
                     }
448
-                    if (! in_array($arr, $ret['select_tables'])) {
448
+                    if (!in_array($arr, $ret['select_tables'])) {
449 449
                         $ret['select_tables'][] = $arr;
450 450
                     }
451 451
                 } else {
@@ -464,7 +464,7 @@  discard block
 block discarded – undo
464 464
                             (isset($expr->database) && ($expr->database !== '')) ?
465 465
                                 $expr->database : null
466 466
                         );
467
-                        if (! in_array($arr, $ret['select_tables'])) {
467
+                        if (!in_array($arr, $ret['select_tables'])) {
468 468
                             $ret['select_tables'][] = $arr;
469 469
                         }
470 470
                     }
@@ -501,7 +501,7 @@  discard block
 block discarded – undo
501 501
         ) {
502 502
             $expressions = array($statement->table);
503 503
         } elseif ($statement instanceof DropStatement) {
504
-            if (! $statement->options->has('TABLE')) {
504
+            if (!$statement->options->has('TABLE')) {
505 505
                 // No tables are dropped.
506 506
                 return array();
507 507
             }
@@ -514,7 +514,7 @@  discard block
 block discarded – undo
514 514
 
515 515
         $ret = array();
516 516
         foreach ($expressions as $expr) {
517
-            if (! empty($expr->table)) {
517
+            if (!empty($expr->table)) {
518 518
                 $expr->expr = null; // Force rebuild.
519 519
                 $expr->alias = null; // Aliases are not required.
520 520
                 $ret[] = Expression::build($expr);
@@ -786,7 +786,7 @@  discard block
 block discarded – undo
786 786
 
787 787
             $statement .= $token->token;
788 788
 
789
-            if (($token->type === Token::TYPE_DELIMITER) && ! empty($token->token)) {
789
+            if (($token->type === Token::TYPE_DELIMITER) && !empty($token->token)) {
790 790
                 $delimiter = $token->token;
791 791
                 $fullStatement = true;
792 792
                 break;
@@ -795,7 +795,7 @@  discard block
 block discarded – undo
795 795
 
796 796
         // No statement was found so we return the entire query as being the
797 797
         // remaining part.
798
-        if (! $fullStatement) {
798
+        if (!$fullStatement) {
799 799
             return array(
800 800
                 null,
801 801
                 $query,
Please login to merge, or discard this patch.