@@ -111,7 +111,7 @@ |
||
| 111 | 111 | $result = $this; |
| 112 | 112 | |
| 113 | 113 | if (method_exists($this, $method)) { |
| 114 | - $result = call_user_func_array([ $this, $method ], $parameters); |
|
| 114 | + $result = call_user_func_array([$this, $method], $parameters); |
|
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | return $result; |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | */ |
| 43 | 43 | public function getColumns($tableName) |
| 44 | 44 | { |
| 45 | - return $this->getColumnsFromQuery($tableName, 'PRAGMA table_info("' . $tableName . '");'); |
|
| 45 | + return $this->getColumnsFromQuery($tableName, 'PRAGMA table_info("'.$tableName.'");'); |
|
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | /** |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | */ |
| 123 | 123 | protected function setForeignColumn($tableName, Column $column) |
| 124 | 124 | { |
| 125 | - $query = $this->pdo->prepare('PRAGMA foreign_key_list("' . $tableName . '");'); |
|
| 125 | + $query = $this->pdo->prepare('PRAGMA foreign_key_list("'.$tableName.'");'); |
|
| 126 | 126 | |
| 127 | 127 | $query->execute(); |
| 128 | 128 | $query->setFetchMode(\PDO::FETCH_OBJ); |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | */ |
| 149 | 149 | protected function setProperties($row, Column $column) |
| 150 | 150 | { |
| 151 | - if (! $row->notnull) { |
|
| 151 | + if ( ! $row->notnull) { |
|
| 152 | 152 | $column->setNull(true); |
| 153 | 153 | } |
| 154 | 154 | |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | */ |
| 45 | 45 | public function getColumns($tableName) |
| 46 | 46 | { |
| 47 | - return $this->getColumnsFromQuery($tableName, 'DESCRIBE ' . $tableName); |
|
| 47 | + return $this->getColumnsFromQuery($tableName, 'DESCRIBE '.$tableName); |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | /** |
@@ -159,19 +159,19 @@ discard block |
||
| 159 | 159 | */ |
| 160 | 160 | protected function setForeignColumn($tableName, $row, Column $column) |
| 161 | 161 | { |
| 162 | - $query = 'SELECT COLUMN_NAME as "column",' . |
|
| 163 | - 'REFERENCED_COLUMN_NAME as "referenced_column",' . |
|
| 164 | - 'CONCAT(REFERENCED_TABLE_SCHEMA, ".", REFERENCED_TABLE_NAME) as "referenced_table"' . |
|
| 165 | - 'FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE ' . |
|
| 166 | - 'WHERE CONSTRAINT_SCHEMA = "' . $this->database . '" ' . |
|
| 167 | - 'AND TABLE_NAME = "' . $tableName . '";'; |
|
| 162 | + $query = 'SELECT COLUMN_NAME as "column",'. |
|
| 163 | + 'REFERENCED_COLUMN_NAME as "referenced_column",'. |
|
| 164 | + 'CONCAT(REFERENCED_TABLE_SCHEMA, ".", REFERENCED_TABLE_NAME) as "referenced_table"'. |
|
| 165 | + 'FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE '. |
|
| 166 | + 'WHERE CONSTRAINT_SCHEMA = "'.$this->database.'" '. |
|
| 167 | + 'AND TABLE_NAME = "'.$tableName.'";'; |
|
| 168 | 168 | |
| 169 | 169 | $foreignTable = $this->pdo->prepare($query); |
| 170 | 170 | |
| 171 | 171 | $foreignTable->execute(); |
| 172 | 172 | $foreignTable->setFetchMode(\PDO::FETCH_OBJ); |
| 173 | 173 | |
| 174 | - $callback = function ($item) use ($row) { |
|
| 174 | + $callback = function($item) use ($row) { |
|
| 175 | 175 | return $item->column == $row->Field; |
| 176 | 176 | }; |
| 177 | 177 | |
@@ -211,8 +211,8 @@ discard block |
||
| 211 | 211 | */ |
| 212 | 212 | public function setDataType($dataType) |
| 213 | 213 | { |
| 214 | - $dataTypes = [ 'integer', 'string', 'string' ]; |
|
| 215 | - $shortHand = [ 'int', 'varchar', 'text' ]; |
|
| 214 | + $dataTypes = ['integer', 'string', 'string']; |
|
| 215 | + $shortHand = ['int', 'varchar', 'text']; |
|
| 216 | 216 | |
| 217 | 217 | $index = array_search($dataType, $shortHand); |
| 218 | 218 | |
@@ -351,7 +351,7 @@ discard block |
||
| 351 | 351 | $method = \Doctrine\Common\Inflector\Inflector::camelize($method); |
| 352 | 352 | |
| 353 | 353 | if (method_exists($this, $method)) { |
| 354 | - return call_user_func_array([ $this, $method ], $parameters); |
|
| 354 | + return call_user_func_array([$this, $method], $parameters); |
|
| 355 | 355 | } |
| 356 | 356 | |
| 357 | 357 | return $this; |