@@ -53,7 +53,7 @@ |
||
53 | 53 | */ |
54 | 54 | public function getTablesCollation($database, $table) |
55 | 55 | { |
56 | - $sql =' SELECT c.collation_name |
|
56 | + $sql = ' SELECT c.collation_name |
|
57 | 57 | FROM information_schema.`TABLES` t |
58 | 58 | INNER JOIN information_schema.`COLLATION_CHARACTER_SET_APPLICABILITY` c ON c.collation_name = t.table_collation |
59 | 59 | WHERE |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | { |
75 | 75 | $isEnum = explode('enum', $this->type); |
76 | 76 | if (!empty($isEnum)) { |
77 | - $numberElements = substr_count(str_replace(['(', ')', "'",], '', $isEnum[1]), ',') + 1; |
|
77 | + $numberElements = substr_count(str_replace(['(', ')', "'", ], '', $isEnum[1]), ',') + 1; |
|
78 | 78 | if ($numberElements == 2) { |
79 | 79 | $this->type = 'tinyint'; |
80 | 80 | $this->length = 1; |
@@ -115,10 +115,10 @@ discard block |
||
115 | 115 | } |
116 | 116 | $null = $this->getNullable() ? '' : 'NOT'; |
117 | 117 | $default = $this->getDefaultValue() == false ? '' : ' DEFAULT ' . $this->getDefaultValue(); |
118 | - $collate = $this->getCollate()==''?'':sprintf("COLLATE '%s'", $this->getCollate()); |
|
118 | + $collate = $this->getCollate() == '' ? '' : sprintf("COLLATE '%s'", $this->getCollate()); |
|
119 | 119 | $modification = sprintf('ALTER TABLE `%s` ADD COLUMN `%s` %s %s NULL %s %s %s;', $this->getTable(), $this->getName(), $this->getColonneType(), $null, $default, $this->getExtra(), $collate); |
120 | 120 | |
121 | - return [str_replace([' ', ' ',], ' ', $modification)]; |
|
121 | + return [str_replace([' ', ' ', ], ' ', $modification)]; |
|
122 | 122 | } |
123 | 123 | |
124 | 124 | /** |
@@ -189,9 +189,9 @@ discard block |
||
189 | 189 | $null = $this->getNullable() ? '' : 'NOT'; |
190 | 190 | $default = $this->getDefaultValue() == false ? '' : ' DEFAULT ' . $this->getDefaultValue(); |
191 | 191 | $columnName = '`' . $this->getName() . '`'; |
192 | - $collate = $this->getCollate()==''?'':sprintf("COLLATE '%s'", $this->getCollate()); |
|
192 | + $collate = $this->getCollate() == '' ? '' : sprintf("COLLATE '%s'", $this->getCollate()); |
|
193 | 193 | $modification = sprintf('ALTER TABLE `%s` CHANGE COLUMN %s %s %s %s NULL %s %s %s;', $this->getTable(), $columnName, $columnName, $this->getColonneType(), $null, $default, $this->getExtra(), $collate); |
194 | 194 | |
195 | - return [str_replace([' ', ' ',], ' ', $modification)]; |
|
195 | + return [str_replace([' ', ' ', ], ' ', $modification)]; |
|
196 | 196 | } |
197 | 197 | } |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | } |
174 | 174 | foreach ($columns as $column) { |
175 | 175 | try { |
176 | - if($this->getCollate() == ''){ |
|
176 | + if ($this->getCollate() == '') { |
|
177 | 177 | $column->setCollate(''); |
178 | 178 | } |
179 | 179 | $modifications[] = $column->createStatement(); |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | { |
208 | 208 | $statements = []; |
209 | 209 | foreach ($modificationsBetweenTable as $modifications) { |
210 | - foreach ((array)$modifications as $modification) { |
|
210 | + foreach ((array) $modifications as $modification) { |
|
211 | 211 | $statements[] = $modification; |
212 | 212 | } |
213 | 213 | } |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | } |
223 | 223 | $tmp = []; |
224 | 224 | foreach ($modifications as $modification) { |
225 | - $tmp[] = trim(str_replace(['ALTER TABLE `' . $this->getTable() . '` ADD COLUMN', 'ALTER TABLE `' . $this->getTable() . '` ADD ', ';',], '', $modification)); |
|
225 | + $tmp[] = trim(str_replace(['ALTER TABLE `' . $this->getTable() . '` ADD COLUMN', 'ALTER TABLE `' . $this->getTable() . '` ADD ', ';', ], '', $modification)); |
|
226 | 226 | } |
227 | 227 | $collate = $this->getCollate() == '' ? '' : sprintf("COLLATE='%s'", $this->getCollate()); |
228 | 228 |