Completed
Branch master (d72e88)
by Maksim
04:06
created
src/BaseLookupCollection.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -106,7 +106,7 @@
 block discarded – undo
106 106
 
107 107
             case 'in':
108 108
                 if (is_array($value)) {
109
-                    $quotedValues = array_map(function ($item) use ($adapter) {
109
+                    $quotedValues = array_map(function($item) use ($adapter) {
110 110
                         return $adapter->quoteValue($item);
111 111
                     }, $value);
112 112
                     $sqlValue = implode(', ', $quotedValues);
Please login to merge, or discard this patch.
src/BaseAdapter.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
     public function setDriver($driver)
109 109
     {
110 110
         if (!($driver instanceof \PDO || $driver instanceof Connection)) {
111
-            throw new QBException('Drive must be instance PDO or '. Connection::class);
111
+            throw new QBException('Drive must be instance PDO or ' . Connection::class);
112 112
         }
113 113
 
114 114
         $this->driver = $driver;
@@ -340,7 +340,7 @@  discard block
 block discarded – undo
340 340
                 $values[] = '(' . implode(', ', $record) . ')';
341 341
             }
342 342
 
343
-            $sql = 'INSERT'. $options .' INTO ' . $this->quoteTableName($tableName) . ' (' . implode(', ', $columns) . ') VALUES ' . implode(', ', $values);
343
+            $sql = 'INSERT' . $options . ' INTO ' . $this->quoteTableName($tableName) . ' (' . implode(', ', $columns) . ') VALUES ' . implode(', ', $values);
344 344
 
345 345
             return $this->quoteSql($sql);
346 346
         }
@@ -348,7 +348,7 @@  discard block
 block discarded – undo
348 348
         $values = array_map([$this, 'quoteValue'], $rows);
349 349
         $columns = array_map([$this, 'quoteColumn'], array_keys($rows));
350 350
 
351
-        $sql = 'INSERT'. $options .' INTO ' . $this->quoteTableName($tableName) . ' (' . implode(', ', $columns) . ') VALUES (' . implode(', ', $values) . ')';
351
+        $sql = 'INSERT' . $options . ' INTO ' . $this->quoteTableName($tableName) . ' (' . implode(', ', $columns) . ') VALUES (' . implode(', ', $values) . ')';
352 352
 
353 353
         return $this->quoteSql($sql);
354 354
     }
@@ -364,7 +364,7 @@  discard block
 block discarded – undo
364 364
             $options = " {$options} ";
365 365
         }
366 366
 
367
-        return 'UPDATE '. $options . $this->quoteTableName($tableName) . ' SET ' . implode(', ', $parts);
367
+        return 'UPDATE ' . $options . $this->quoteTableName($tableName) . ' SET ' . implode(', ', $parts);
368 368
     }
369 369
 
370 370
     /**
@@ -629,12 +629,12 @@  discard block
 block discarded – undo
629 629
         $toSql = [$joinType];
630 630
         if (is_string($tableName) && $tableName = $this->getRawTableName($tableName)) {
631 631
             if (strpos($tableName, 'SELECT') !== false) {
632
-                $toSql[] = '(' . $this->quoteSql($tableName) . ')' ;
632
+                $toSql[] = '(' . $this->quoteSql($tableName) . ')';
633 633
             } else {
634
-                $toSql[]  = $this->quoteTableName($tableName);
634
+                $toSql[] = $this->quoteTableName($tableName);
635 635
             }
636 636
         } else if ($tableName instanceof QueryBuilder) {
637
-            $toSql[] =  '(' . $this->quoteSql($tableName->toSQL()) . ')' ;
637
+            $toSql[] = '(' . $this->quoteSql($tableName->toSQL()) . ')';
638 638
         } else {
639 639
             throw new QBException('Incorrect table name');
640 640
         }
Please login to merge, or discard this patch.
Braces   +5 added lines, -10 removed lines patch added patch discarded remove patch
@@ -806,8 +806,7 @@  discard block
 block discarded – undo
806 806
                 if (!is_numeric($column)) {
807 807
                     $value .= ' AS ' . $this->quoteColumn($column);
808 808
                 }
809
-            }
810
-            else {
809
+            } else {
811 810
                 $subQuery = $this->quoteSql($expr);
812 811
 
813 812
                 if (is_numeric($column)) {
@@ -818,12 +817,10 @@  discard block
 block discarded – undo
818 817
                 if (!empty($subQuery)) {
819 818
                     if (strpos($subQuery, 'SELECT') !== false) {
820 819
                         $value = '(' . $subQuery . ') AS ' . $this->quoteColumn($column);
821
-                    }
822
-                    else {
820
+                    } else {
823 821
                         $value = $this->quoteColumn($subQuery) . ' AS ' . $this->quoteColumn($column);
824 822
                     }
825
-                }
826
-                else if (strpos($column, ',') === false && strpos($column, 'AS') !== false) {
823
+                } else if (strpos($column, ',') === false && strpos($column, 'AS') !== false) {
827 824
 
828 825
                     list($rawColumn, $rawAlias) = explode('AS', $column);
829 826
                     $value = $this->quoteColumn(trim($rawColumn));
@@ -831,8 +828,7 @@  discard block
 block discarded – undo
831 828
                     if (!empty($rawAlias)) {
832 829
                         $value .= ' AS ' . $this->quoteColumn(trim($rawAlias));
833 830
                     }
834
-                }
835
-                else if (strpos($column, ',') !== false) {
831
+                } else if (strpos($column, ',') !== false) {
836 832
                     $newSelect = [];
837 833
 
838 834
                     foreach (explode(',', $column) as $item) {
@@ -853,8 +849,7 @@  discard block
 block discarded – undo
853 849
                     }
854 850
                     $value = implode(', ', $newSelect);
855 851
 
856
-                }
857
-                else {
852
+                } else {
858 853
                     $value = $this->quoteColumn($column);
859 854
                 }
860 855
             }
Please login to merge, or discard this patch.
src/Expression/Expression.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -50,10 +50,10 @@
 block discarded – undo
50 50
         if (strpos($sql, '?'))
51 51
         {
52 52
             if (mb_substr_count($sql, '?') !== count($this->params)) {
53
-                throw new QBException('Incorrect parameters count in Expression: "'.addslashes($this->expression).'"');
53
+                throw new QBException('Incorrect parameters count in Expression: "' . addslashes($this->expression) . '"');
54 54
             }
55 55
 
56
-            $sql = preg_replace_callback('~\?~', function ($matches) {
56
+            $sql = preg_replace_callback('~\?~', function($matches) {
57 57
                 return $this->qb->getAdapter()->quoteValue(
58 58
                     $this->getNextParam()
59 59
                 );
Please login to merge, or discard this patch.
src/QueryBuilder.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -823,7 +823,7 @@  discard block
 block discarded – undo
823 823
 
824 824
     public function generateDeleteSql()
825 825
     {
826
-        $options = $this->_queryOptions ;
826
+        $options = $this->_queryOptions;
827 827
         if ($options) {
828 828
             $options = " {$options} ";
829 829
         }
@@ -980,7 +980,7 @@  discard block
 block discarded – undo
980 980
         $tableName = $this->getAdapter()->getRawTableName($table);
981 981
 
982 982
         if (strpos($tableName, '.') !== false) {
983
-            $tableName = substr($tableName, strpos($tableName, '.')+1);
983
+            $tableName = substr($tableName, strpos($tableName, '.') + 1);
984 984
         }
985 985
 
986 986
         return strtr('{table}_{count}', [
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1120,8 +1120,7 @@
 block discarded – undo
1120 1120
             foreach ($this->_order as $column) {
1121 1121
                 if ($column instanceof Expression) {
1122 1122
                     $order[$column->toSQL()] = '';
1123
-                }
1124
-                else if ($column === '?') {
1123
+                } else if ($column === '?') {
1125 1124
                     $order[] = $this->getAdapter()->getRandomOrder();
1126 1125
                 } else {
1127 1126
                     list($newColumn, $direction) = $this->buildOrderJoin($column);
Please login to merge, or discard this patch.