Completed
Pull Request — master (#112)
by Michal
374:43 queued 309:52
created
src/Statements/InsertStatement.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -109,19 +109,19 @@
 block discarded – undo
109 109
      */
110 110
     public function build()
111 111
     {
112
-        $ret = 'INSERT '.$this->options
113
-            .' INTO '.$this->into;
112
+        $ret = 'INSERT ' . $this->options
113
+            .' INTO ' . $this->into;
114 114
 
115 115
         if ($this->values != null && count($this->values) > 0) {
116
-            $ret .= ' VALUES '.Array2d::build($this->values);
116
+            $ret .= ' VALUES ' . Array2d::build($this->values);
117 117
         } elseif ($this->set != null && count($this->set) > 0) {
118
-            $ret .= ' SET '.SetOperation::build($this->set);
118
+            $ret .= ' SET ' . SetOperation::build($this->set);
119 119
         } elseif ($this->select != null && strlen($this->select) > 0) {
120
-            $ret .= ' '.$this->select->build();
120
+            $ret .= ' ' . $this->select->build();
121 121
         }
122 122
 
123 123
         if ($this->onDuplicateSet != null && count($this->onDuplicateSet) > 0) {
124
-            $ret .= ' ON DUPLICATE KEY UPDATE '.SetOperation::build($this->onDuplicateSet);
124
+            $ret .= ' ON DUPLICATE KEY UPDATE ' . SetOperation::build($this->onDuplicateSet);
125 125
         }
126 126
 
127 127
         return $ret;
Please login to merge, or discard this patch.
src/Statements/SetStatement.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
      * @var array
28 28
      */
29 29
     public static $CLAUSES = array(
30
-        'SET' => array('SET',         3),
30
+        'SET' => array('SET', 3),
31 31
     );
32 32
 
33 33
     /**
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
      */
62 62
     public function build()
63 63
     {
64
-        return 'SET '.OptionsArray::build($this->options)
65
-            .' '.SetOperation::build($this->set);
64
+        return 'SET ' . OptionsArray::build($this->options)
65
+            .' ' . SetOperation::build($this->set);
66 66
     }
67 67
 }
Please login to merge, or discard this patch.
src/Statements/CreateStatement.php 1 patch
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -269,82 +269,82 @@
 block discarded – undo
269 269
         $fields = '';
270 270
         if (!empty($this->fields)) {
271 271
             if (is_array($this->fields)) {
272
-                $fields = CreateDefinition::build($this->fields).' ';
272
+                $fields = CreateDefinition::build($this->fields) . ' ';
273 273
             } elseif ($this->fields instanceof ArrayObj) {
274 274
                 $fields = ArrayObj::build($this->fields);
275 275
             }
276 276
         }
277 277
         if ($this->options->has('DATABASE')) {
278 278
             return 'CREATE '
279
-                .OptionsArray::build($this->options).' '
280
-                .Expression::build($this->name).' '
279
+                .OptionsArray::build($this->options) . ' '
280
+                .Expression::build($this->name) . ' '
281 281
                 .OptionsArray::build($this->entityOptions);
282 282
         } elseif ($this->options->has('TABLE') && !is_null($this->select)) {
283 283
             return 'CREATE '
284
-                .OptionsArray::build($this->options).' '
285
-                .Expression::build($this->name).' '
284
+                .OptionsArray::build($this->options) . ' '
285
+                .Expression::build($this->name) . ' '
286 286
                 .$this->select->build();
287 287
         } elseif ($this->options->has('TABLE') && !is_null($this->like)) {
288 288
             return 'CREATE '
289
-                .OptionsArray::build($this->options).' '
290
-                .Expression::build($this->name).' LIKE '
289
+                .OptionsArray::build($this->options) . ' '
290
+                .Expression::build($this->name) . ' LIKE '
291 291
                 .Expression::build($this->like);
292 292
         } elseif ($this->options->has('TABLE')) {
293 293
             $partition = '';
294 294
 
295 295
             if (!empty($this->partitionBy)) {
296
-                $partition .= "\nPARTITION BY ".$this->partitionBy;
296
+                $partition .= "\nPARTITION BY " . $this->partitionBy;
297 297
             }
298 298
             if (!empty($this->partitionsNum)) {
299
-                $partition .= "\nPARTITIONS ".$this->partitionsNum;
299
+                $partition .= "\nPARTITIONS " . $this->partitionsNum;
300 300
             }
301 301
             if (!empty($this->subpartitionBy)) {
302
-                $partition .= "\nSUBPARTITION BY ".$this->subpartitionBy;
302
+                $partition .= "\nSUBPARTITION BY " . $this->subpartitionBy;
303 303
             }
304 304
             if (!empty($this->subpartitionsNum)) {
305
-                $partition .= "\nSUBPARTITIONS ".$this->subpartitionsNum;
305
+                $partition .= "\nSUBPARTITIONS " . $this->subpartitionsNum;
306 306
             }
307 307
             if (!empty($this->partitions)) {
308
-                $partition .= "\n".PartitionDefinition::build($this->partitions);
308
+                $partition .= "\n" . PartitionDefinition::build($this->partitions);
309 309
             }
310 310
 
311 311
             return 'CREATE '
312
-                .OptionsArray::build($this->options).' '
313
-                .Expression::build($this->name).' '
312
+                .OptionsArray::build($this->options) . ' '
313
+                .Expression::build($this->name) . ' '
314 314
                 .$fields
315 315
                 .OptionsArray::build($this->entityOptions)
316 316
                 .$partition;
317 317
         } elseif ($this->options->has('VIEW')) {
318 318
             return 'CREATE '
319
-                .OptionsArray::build($this->options).' '
320
-                .Expression::build($this->name).' '
321
-                .$fields.' AS '.TokensList::build($this->body).' '
319
+                .OptionsArray::build($this->options) . ' '
320
+                .Expression::build($this->name) . ' '
321
+                .$fields . ' AS ' . TokensList::build($this->body) . ' '
322 322
                 .OptionsArray::build($this->entityOptions);
323 323
         } elseif ($this->options->has('TRIGGER')) {
324 324
             return 'CREATE '
325
-                .OptionsArray::build($this->options).' '
326
-                .Expression::build($this->name).' '
327
-                .OptionsArray::build($this->entityOptions).' '
328
-                .'ON '.Expression::build($this->table).' '
329
-                .'FOR EACH ROW '.TokensList::build($this->body);
325
+                .OptionsArray::build($this->options) . ' '
326
+                .Expression::build($this->name) . ' '
327
+                .OptionsArray::build($this->entityOptions) . ' '
328
+                .'ON ' . Expression::build($this->table) . ' '
329
+                .'FOR EACH ROW ' . TokensList::build($this->body);
330 330
         } elseif (($this->options->has('PROCEDURE'))
331 331
             || ($this->options->has('FUNCTION'))
332 332
         ) {
333 333
             $tmp = '';
334 334
             if ($this->options->has('FUNCTION')) {
335
-                $tmp = 'RETURNS '.DataType::build($this->return);
335
+                $tmp = 'RETURNS ' . DataType::build($this->return);
336 336
             }
337 337
 
338 338
             return 'CREATE '
339
-                .OptionsArray::build($this->options).' '
340
-                .Expression::build($this->name).' '
341
-                .ParameterDefinition::build($this->parameters).' '
342
-                .$tmp.' '.TokensList::build($this->body);
339
+                .OptionsArray::build($this->options) . ' '
340
+                .Expression::build($this->name) . ' '
341
+                .ParameterDefinition::build($this->parameters) . ' '
342
+                .$tmp . ' ' . TokensList::build($this->body);
343 343
         }
344 344
 
345 345
         return 'CREATE '
346
-            .OptionsArray::build($this->options).' '
347
-            .Expression::build($this->name).' '
346
+            .OptionsArray::build($this->options) . ' '
347
+            .Expression::build($this->name) . ' '
348 348
             .TokensList::build($this->body);
349 349
     }
350 350
 
Please login to merge, or discard this patch.
src/Statements/TransactionStatement.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -104,9 +104,9 @@
 block discarded – undo
104 104
                 /*
105 105
                  * @var SelectStatement $statement
106 106
                  */
107
-                $ret .= ';'.$statement->build();
107
+                $ret .= ';' . $statement->build();
108 108
             }
109
-            $ret .= ';'.$this->end->build();
109
+            $ret .= ';' . $this->end->build();
110 110
         }
111 111
 
112 112
         return $ret;
Please login to merge, or discard this patch.
src/Utils/BufferedQuery.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
              * be ignored.
195 195
              */
196 196
             if ((($this->status & static::STATUS_COMMENT) == 0) && ($this->query[$i] === '\\')) {
197
-                $this->current .= $this->query[$i].$this->query[++$i];
197
+                $this->current .= $this->query[$i] . $this->query[++$i];
198 198
                 continue;
199 199
             }
200 200
 
@@ -331,7 +331,7 @@  discard block
 block discarded – undo
331 331
                         // Appending the `DELIMITER` statement that was just
332 332
                         // found to the current statement.
333 333
                         $ret = trim(
334
-                            $this->current.' '.substr($this->query, $iBak, $i - $iBak)
334
+                            $this->current . ' ' . substr($this->query, $iBak, $i - $iBak)
335 335
                         );
336 336
                     }
337 337
 
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
@@ -62,7 +62,7 @@
 block discarded – undo
62 62
      */
63 63
     public static function getParameter($param)
64 64
     {
65
-        $lexer = new Lexer('('.$param.')');
65
+        $lexer = new Lexer('(' . $param . ')');
66 66
 
67 67
         // A dummy parser is used for error reporting.
68 68
         $param = ParameterDefinition::parse(new Parser(), $lexer->list);
Please login to merge, or discard this patch.
src/Token.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
                 return $ret;
262 262
             case self::TYPE_STRING:
263 263
                 $quote = $this->token[0];
264
-                $str = str_replace($quote.$quote, $quote, $this->token);
264
+                $str = str_replace($quote . $quote, $quote, $this->token);
265 265
 
266 266
                 return mb_substr($str, 1, -1, 'UTF-8'); // trims quotes
267 267
             case self::TYPE_SYMBOL:
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
                 || ($str[0] === '"') || ($str[0] === '\''))
281 281
                 ) {
282 282
                     $quote = $str[0];
283
-                    $str = str_replace($quote.$quote, $quote, $str);
283
+                    $str = str_replace($quote . $quote, $quote, $str);
284 284
                     $str = mb_substr($str, 1, -1, 'UTF-8');
285 285
                 }
286 286
 
Please login to merge, or discard this patch.
src/Statement.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -173,12 +173,12 @@
 block discarded – undo
173 173
 
174 174
             // Checking if the name of the clause should be added.
175 175
             if ($type & 2) {
176
-                $query .= $name.' ';
176
+                $query .= $name . ' ';
177 177
             }
178 178
 
179 179
             // Checking if the result of the builder should be added.
180 180
             if ($type & 1) {
181
-                $query .= $class::build($this->$field).' ';
181
+                $query .= $class::build($this->$field) . ' ';
182 182
             }
183 183
         }
184 184
 
Please login to merge, or discard this patch.
src/Lexer.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -275,7 +275,7 @@  discard block
 block discarded – undo
275 275
                 $lastToken->token .= $token->token;
276 276
                 $lastToken->type = Token::TYPE_SYMBOL;
277 277
                 $lastToken->flags = Token::FLAG_SYMBOL_USER;
278
-                $lastToken->value .= '@'.$token->value;
278
+                $lastToken->value .= '@' . $token->value;
279 279
                 continue;
280 280
             } elseif (($lastToken !== null)
281 281
                 && ($token->type === Token::TYPE_KEYWORD)
@@ -651,8 +651,8 @@  discard block
 block discarded – undo
651 651
         }
652 652
 
653 653
         $iBak = $this->last;
654
-        $token = $this->str[$this->last].$this->str[++$this->last]
655
-        .$this->str[++$this->last].$this->str[++$this->last]; // _TRUE_ or _FALS_e
654
+        $token = $this->str[$this->last] . $this->str[++$this->last]
655
+        .$this->str[++$this->last] . $this->str[++$this->last]; // _TRUE_ or _FALS_e
656 656
 
657 657
         if (Context::isBool($token)) {
658 658
             return new Token($token, Token::TYPE_BOOL);
@@ -828,7 +828,7 @@  discard block
 block discarded – undo
828 828
                 && ((($this->str[$this->last] === $quote) && ($this->str[$this->last + 1] === $quote))
829 829
                 || (($this->str[$this->last] === '\\') && ($quote !== '`')))
830 830
             ) {
831
-                $token .= $this->str[$this->last].$this->str[++$this->last];
831
+                $token .= $this->str[$this->last] . $this->str[++$this->last];
832 832
             } else {
833 833
                 if ($this->str[$this->last] === $quote) {
834 834
                     break;
Please login to merge, or discard this patch.