@@ -188,7 +188,7 @@ |
||
188 | 188 | { |
189 | 189 | $statements = []; |
190 | 190 | foreach ($modificationsBetweenTable as $modifications) { |
191 | - foreach ((array)$modifications as $modification) { |
|
191 | + foreach ((array) $modifications as $modification) { |
|
192 | 192 | $statements[] = $modification; |
193 | 193 | } |
194 | 194 | } |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | { |
195 | 195 | $statements = []; |
196 | 196 | foreach ($modificationsBetweenTable as $modifications) { |
197 | - foreach ((array)$modifications as $modification) { |
|
197 | + foreach ((array) $modifications as $modification) { |
|
198 | 198 | $statements[] = $modification; |
199 | 199 | } |
200 | 200 | } |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | } |
210 | 210 | $tmp = []; |
211 | 211 | foreach ($modifications as $modification) { |
212 | - $tmp[] = trim(str_replace(['ALTER TABLE `' . $this->getTable() . '` ADD COLUMN', 'ALTER TABLE `' . $this->getTable() . '` ADD ', ';',], '', $modification)); |
|
212 | + $tmp[] = trim(str_replace(['ALTER TABLE `' . $this->getTable() . '` ADD COLUMN', 'ALTER TABLE `' . $this->getTable() . '` ADD ', ';', ], '', $modification)); |
|
213 | 213 | } |
214 | 214 | $collate = $this->getCollate() == '' ? '' : sprintf("COLLATE='%s'", $this->getCollate()); |
215 | 215 |
@@ -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; |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | $collate = $this->getCollate() == '' ? '' : sprintf("COLLATE '%s'", $this->getCollate()); |
107 | 107 | $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); |
108 | 108 | |
109 | - return [str_replace([' ', ' ',], ' ', $modification)]; |
|
109 | + return [str_replace([' ', ' ', ], ' ', $modification)]; |
|
110 | 110 | } |
111 | 111 | |
112 | 112 | /** |
@@ -180,6 +180,6 @@ discard block |
||
180 | 180 | $collate = $this->getCollate() == '' ? '' : sprintf("COLLATE '%s'", $this->getCollate()); |
181 | 181 | $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); |
182 | 182 | |
183 | - return [str_replace([' ', ' ',], ' ', $modification)]; |
|
183 | + return [str_replace([' ', ' ', ], ' ', $modification)]; |
|
184 | 184 | } |
185 | 185 | } |
@@ -75,10 +75,10 @@ |
||
75 | 75 | continue; |
76 | 76 | } |
77 | 77 | $key = 'indexes'; |
78 | - if(!$row['NON_UNIQUE']) { |
|
78 | + if (!$row['NON_UNIQUE']) { |
|
79 | 79 | $key = 'uniques'; |
80 | 80 | } |
81 | - if(!$row['NON_FULLTEXT']) { |
|
81 | + if (!$row['NON_FULLTEXT']) { |
|
82 | 82 | $key = 'fulltexts'; |
83 | 83 | } |
84 | 84 | $export[$key][] = array_filter(['name' => $row['INDEX_NAME'], 'columns' => explode(',', $row['COLUMN_NAME'])]); |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | if (isset($dataTable['collate'])) { |
58 | 58 | $table->setCollate($dataTable['collate']); |
59 | 59 | } |
60 | - foreach ((array)$dataTable['columns'] as $columnName => $row) { |
|
60 | + foreach ((array) $dataTable['columns'] as $columnName => $row) { |
|
61 | 61 | $column = new MysqlDatabaseColumn($columnName, $row['type'], $row['length'], $row['nullable'], $row['defaultValue'], $row['extra']); |
62 | 62 | if (isset($row['collate']) || $table->getCollate()) { |
63 | 63 | $column->setCollate($row['collate']); |
@@ -65,13 +65,13 @@ discard block |
||
65 | 65 | $table->addColumn($column); |
66 | 66 | |
67 | 67 | } |
68 | - foreach ((array)$dataTable['indexes'] as $row) { |
|
68 | + foreach ((array) $dataTable['indexes'] as $row) { |
|
69 | 69 | $table->addIndex($row['columns'], $row['name']); |
70 | 70 | } |
71 | 71 | if (isset($dataTable['primary'])) { |
72 | - $table->addPrimary((array)$dataTable['primary']); |
|
72 | + $table->addPrimary((array) $dataTable['primary']); |
|
73 | 73 | } |
74 | - foreach ((array)$dataTable['uniques'] as $row) { |
|
74 | + foreach ((array) $dataTable['uniques'] as $row) { |
|
75 | 75 | $table->addUnique($row['columns'], $row['name']); |
76 | 76 | } |
77 | 77 | $tables[] = $table; |
@@ -131,11 +131,11 @@ discard block |
||
131 | 131 | $export = []; |
132 | 132 | foreach ($data as $nomTable => $table) { |
133 | 133 | $dataTable = $resolverTable->resolve($table); |
134 | - foreach ((array)$dataTable['columns'] as $columnName => $column) { |
|
134 | + foreach ((array) $dataTable['columns'] as $columnName => $column) { |
|
135 | 135 | $dataTable['columns'][$columnName] = $resolverColumns->resolve($column); |
136 | 136 | } |
137 | 137 | foreach (['indexes', 'uniques'] as $indexKey) { |
138 | - foreach ((array)$dataTable[$indexKey] as $keyIndex => $index) { |
|
138 | + foreach ((array) $dataTable[$indexKey] as $keyIndex => $index) { |
|
139 | 139 | $dataTable[$indexKey][$keyIndex] = $resolverIndex->resolve($index); |
140 | 140 | } |
141 | 141 | } |