@@ -259,7 +259,7 @@ |
||
| 259 | 259 | * @return int |
| 260 | 260 | */ |
| 261 | 261 | public function getLength() { |
| 262 | - switch($this->getOriginalType()) { |
|
| 262 | + switch ($this->getOriginalType()) { |
|
| 263 | 263 | case 'BIT': |
| 264 | 264 | case 'TINYINT': |
| 265 | 265 | case 'TINYINT UNSIGNED': |
@@ -391,7 +391,7 @@ |
||
| 391 | 391 | * @return int |
| 392 | 392 | */ |
| 393 | 393 | public function getLength() { |
| 394 | - switch($this->getOriginalType()) { |
|
| 394 | + switch ($this->getOriginalType()) { |
|
| 395 | 395 | case 'TINYINT': |
| 396 | 396 | case 'SMALLINT': |
| 397 | 397 | case 'INT': |
@@ -36,11 +36,11 @@ discard block |
||
| 36 | 36 | $statement = $this->connection->query($query); |
| 37 | 37 | $values = $statement->fetchAssoc(false)['Type']; |
| 38 | 38 | $values = explode("','", substr($values, strpos($values, '(') + 2, -2)); |
| 39 | - $values = array_intersect_key($values,array_unique(array_map("strtolower",$values))); |
|
| 39 | + $values = array_intersect_key($values, array_unique(array_map("strtolower", $values))); |
|
| 40 | 40 | asort($values); |
| 41 | 41 | |
| 42 | 42 | $def .= $MySQLType; |
| 43 | - $def .= '(' . join(', ', array_map(function($c) {return "'".addslashes($c)."'";}, $values)) . ')'; |
|
| 43 | + $def .= '(' . join(', ', array_map(function($c) {return "'" . addslashes($c) . "'"; }, $values)) . ')'; |
|
| 44 | 44 | } |
| 45 | 45 | else if (in_array($MySQLType, array('CHAR', 'VARCHAR')) && $this->getLength() < 64 && $this->getDistinctValueCount() <= 16) { |
| 46 | 46 | $query = sprintf("SELECT DISTINCT %s FROM %s.%s WHERE %s IS NOT NULL ORDER BY %s ASC", |
@@ -53,12 +53,12 @@ discard block |
||
| 53 | 53 | foreach ($this->connection->query($query) as $value) { |
| 54 | 54 | $values[] = trim($value[$this->name]); |
| 55 | 55 | } |
| 56 | - $values = array_intersect_key($values,array_unique(array_map("strtolower",$values))); |
|
| 56 | + $values = array_intersect_key($values, array_unique(array_map("strtolower", $values))); |
|
| 57 | 57 | asort($values); |
| 58 | 58 | |
| 59 | 59 | if ($values) { |
| 60 | 60 | $def .= 'ENUM'; |
| 61 | - $def .= '(' . join(', ', array_map(function($c) {return "'".addslashes($c)."'";}, $values)) . ')'; |
|
| 61 | + $def .= '(' . join(', ', array_map(function($c) {return "'" . addslashes($c) . "'"; }, $values)) . ')'; |
|
| 62 | 62 | } |
| 63 | 63 | else { |
| 64 | 64 | $def .= $MySQLType; |
@@ -317,7 +317,7 @@ |
||
| 317 | 317 | * @return int |
| 318 | 318 | */ |
| 319 | 319 | public function getLength() { |
| 320 | - switch($this->getOriginalType()) { |
|
| 320 | + switch ($this->getOriginalType()) { |
|
| 321 | 321 | case 'NUMBER': |
| 322 | 322 | case 'CHAR': |
| 323 | 323 | case 'NCHAR': |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | if ($length <= 191) { //skip index if too long for MySQL |
| 128 | 128 | $tableDef .= ',' . PHP_EOL . PHP_EOL; |
| 129 | 129 | $tableDef .= 'PRIMARY KEY ('; |
| 130 | - $tableDef .= join(', ' . PHP_EOL, array_map(function($c) {return '`'.strtolower($c).'`';}, $primaryKey)); |
|
| 130 | + $tableDef .= join(', ' . PHP_EOL, array_map(function($c) {return '`' . strtolower($c) . '`'; }, $primaryKey)); |
|
| 131 | 131 | $tableDef .= ')'; |
| 132 | 132 | } |
| 133 | 133 | } |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | } |
| 152 | 152 | $tableDef .= ',' . PHP_EOL; |
| 153 | 153 | $tableDef .= 'KEY `' . strtolower($indexName) . '` ('; |
| 154 | - $tableDef .= join(", ", array_map(function($c) {return '`'.strtolower($c).'`';}, $indexColumns)); |
|
| 154 | + $tableDef .= join(", ", array_map(function($c) {return '`' . strtolower($c) . '`'; }, $indexColumns)); |
|
| 155 | 155 | $tableDef .= ')'; |
| 156 | 156 | } |
| 157 | 157 | } |
@@ -193,7 +193,7 @@ discard block |
||
| 193 | 193 | if ($primaryKey) { |
| 194 | 194 | $tableDef .= ',' . PHP_EOL . PHP_EOL; |
| 195 | 195 | $tableDef .= 'PRIMARY KEY ('; |
| 196 | - $tableDef .= join(', ' . PHP_EOL, array_map(function($c) {return '"'.strtolower($c).'"';}, $primaryKey)); |
|
| 196 | + $tableDef .= join(', ' . PHP_EOL, array_map(function($c) {return '"' . strtolower($c) . '"'; }, $primaryKey)); |
|
| 197 | 197 | $tableDef .= ')'; |
| 198 | 198 | } |
| 199 | 199 | |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | } |
| 207 | 207 | $tableDef .= ',' . PHP_EOL; |
| 208 | 208 | $tableDef .= 'KEY `' . strtolower($indexName) . '` ('; |
| 209 | - $tableDef .= join(', ', array_map(function($c) {return '"'.strtolower($c).'"';}, $indexColumns)); |
|
| 209 | + $tableDef .= join(', ', array_map(function($c) {return '"' . strtolower($c) . '"'; }, $indexColumns)); |
|
| 210 | 210 | $tableDef .= ')'; |
| 211 | 211 | } |
| 212 | 212 | } |