Passed
Pull Request — master (#584)
by Richard
17:37
created
xoops_lib/Xmf/Database/Tables.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -178,13 +178,13 @@  discard block
 block discarded – undo
178 178
         $columnList = '';
179 179
         $firstComma = '';
180 180
         foreach ($columns as $col) {
181
-            $columnList .= $firstComma . $this->quoteIndexColumnName($col);
181
+            $columnList .= $firstComma.$this->quoteIndexColumnName($col);
182 182
             $firstComma = ', ';
183 183
         }
184 184
         if (isset($this->tables[$table])) {
185 185
             if (isset($this->tables[$table]['create']) && $this->tables[$table]['create']) {
186 186
                 $this->tables[$table]['keys'][$name]['columns'] = $columnList;
187
-                $this->tables[$table]['keys'][$name]['unique'] = (bool) $unique;
187
+                $this->tables[$table]['keys'][$name]['unique'] = (bool)$unique;
188 188
             } else {
189 189
                 $add = ($unique ? 'ADD UNIQUE INDEX' : 'ADD INDEX');
190 190
                 $this->queue[] = "ALTER TABLE `{$this->tables[$table]['name']}` {$add} `{$name}` ({$columnList})";
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
 
213 213
         $lengthPosition = strpos($column, '(');
214 214
         if ($lengthPosition) {
215
-            $length = ' ' . substr($column, $lengthPosition);
215
+            $length = ' '.substr($column, $lengthPosition);
216 216
             $column = substr($column, 0, $lengthPosition);
217 217
         }
218 218
         $quotedName = "`{$column}`{$length}";
@@ -350,7 +350,7 @@  discard block
 block discarded – undo
350 350
 
351 351
                 return true;
352 352
             } else {
353
-                $this->queue[] = "ALTER TABLE `{$tableDef['name']}` " .
353
+                $this->queue[] = "ALTER TABLE `{$tableDef['name']}` ".
354 354
                     "CHANGE COLUMN `{$column}` `{$newName}` {$attributes} ";
355 355
                 // loop thru and find the column
356 356
                 foreach ($tableDef['columns'] as &$col) {
@@ -817,8 +817,8 @@  discard block
 block discarded – undo
817 817
         $sql  = 'SELECT TABLE_NAME, ENGINE, CHARACTER_SET_NAME ';
818 818
         $sql .= ' FROM `INFORMATION_SCHEMA`.`TABLES` t, ';
819 819
         $sql .= ' `INFORMATION_SCHEMA`.`COLLATIONS` c ';
820
-        $sql .= ' WHERE t.TABLE_SCHEMA = \'' . $this->databaseName . '\' ';
821
-        $sql .= ' AND t.TABLE_NAME = \'' . $this->name($table) . '\' ';
820
+        $sql .= ' WHERE t.TABLE_SCHEMA = \''.$this->databaseName.'\' ';
821
+        $sql .= ' AND t.TABLE_NAME = \''.$this->name($table).'\' ';
822 822
         $sql .= ' AND t.TABLE_COLLATION  = c.COLLATION_NAME ';
823 823
 
824 824
         $result = $this->execSql($sql);
@@ -830,21 +830,21 @@  discard block
 block discarded – undo
830 830
             return true;
831 831
         }
832 832
         $tableDef['name'] = $tableSchema['TABLE_NAME'];
833
-        $tableDef['options'] = 'ENGINE=' . $tableSchema['ENGINE'] . ' '
834
-            . 'DEFAULT CHARSET=' . $tableSchema['CHARACTER_SET_NAME'];
833
+        $tableDef['options'] = 'ENGINE='.$tableSchema['ENGINE'].' '
834
+            . 'DEFAULT CHARSET='.$tableSchema['CHARACTER_SET_NAME'];
835 835
 
836 836
         $sql  = 'SELECT * ';
837 837
         $sql .= ' FROM `INFORMATION_SCHEMA`.`COLUMNS` ';
838
-        $sql .= ' WHERE TABLE_SCHEMA = \'' . $this->databaseName . '\' ';
839
-        $sql .= ' AND TABLE_NAME = \'' . $this->name($table) . '\' ';
838
+        $sql .= ' WHERE TABLE_SCHEMA = \''.$this->databaseName.'\' ';
839
+        $sql .= ' AND TABLE_NAME = \''.$this->name($table).'\' ';
840 840
         $sql .= ' ORDER BY `ORDINAL_POSITION` ';
841 841
 
842 842
         $result = $this->execSql($sql);
843 843
 
844 844
         while ($column = $this->fetch($result)) {
845
-            $attributes = ' ' . $column['COLUMN_TYPE'] . ' '
845
+            $attributes = ' '.$column['COLUMN_TYPE'].' '
846 846
                 . (($column['IS_NULLABLE'] === 'NO') ? ' NOT NULL ' : '')
847
-                . (($column['COLUMN_DEFAULT'] === null) ? '' : " DEFAULT '" . $column['COLUMN_DEFAULT'] . "' ")
847
+                . (($column['COLUMN_DEFAULT'] === null) ? '' : " DEFAULT '".$column['COLUMN_DEFAULT']."' ")
848 848
                 . $column['EXTRA'];
849 849
 
850 850
             $columnDef = array(
@@ -858,8 +858,8 @@  discard block
 block discarded – undo
858 858
         $sql  = 'SELECT `INDEX_NAME`, `SEQ_IN_INDEX`, `NON_UNIQUE`, ';
859 859
         $sql .= ' `COLUMN_NAME`, `SUB_PART` ';
860 860
         $sql .= ' FROM `INFORMATION_SCHEMA`.`STATISTICS` ';
861
-        $sql .= ' WHERE TABLE_SCHEMA = \'' . $this->databaseName . '\' ';
862
-        $sql .= ' AND TABLE_NAME = \'' . $this->name($table) . '\' ';
861
+        $sql .= ' WHERE TABLE_SCHEMA = \''.$this->databaseName.'\' ';
862
+        $sql .= ' AND TABLE_NAME = \''.$this->name($table).'\' ';
863 863
         $sql .= ' ORDER BY `INDEX_NAME`, `SEQ_IN_INDEX` ';
864 864
 
865 865
         $result = $this->execSql($sql);
@@ -876,13 +876,13 @@  discard block
 block discarded – undo
876 876
                 $lastKey = $key['INDEX_NAME'];
877 877
                 $keyCols = $key['COLUMN_NAME'];
878 878
                 if (!empty($key['SUB_PART'])) {
879
-                    $keyCols .= ' (' . $key['SUB_PART'] . ')';
879
+                    $keyCols .= ' ('.$key['SUB_PART'].')';
880 880
                 }
881 881
                 $keyUnique = !$key['NON_UNIQUE'];
882 882
             } else {
883
-                $keyCols .= ', ' . $key['COLUMN_NAME'];
883
+                $keyCols .= ', '.$key['COLUMN_NAME'];
884 884
                 if (!empty($key['SUB_PART'])) {
885
-                    $keyCols .= ' (' . $key['SUB_PART'] . ')';
885
+                    $keyCols .= ' ('.$key['SUB_PART'].')';
886 886
                 }
887 887
             }
888 888
         };
Please login to merge, or discard this patch.