@@ -24,7 +24,7 @@ |
||
| 24 | 24 | $result = $object; |
| 25 | 25 | |
| 26 | 26 | if (method_exists($object, $method)) { |
| 27 | - $result = call_user_func_array([ $object, $method ], $parameters); |
|
| 27 | + $result = call_user_func_array([$object, $method], $parameters); |
|
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | return $result; |
@@ -43,13 +43,13 @@ discard block |
||
| 43 | 43 | */ |
| 44 | 44 | public function getDriver($driverName, $configuration = []) |
| 45 | 45 | { |
| 46 | - $mysql = [ 'mysql', 'mysqli' ]; |
|
| 47 | - $sqlite = [ 'pdo', 'sqlite', 'sqlite3' ]; |
|
| 46 | + $mysql = ['mysql', 'mysqli']; |
|
| 47 | + $sqlite = ['pdo', 'sqlite', 'sqlite3']; |
|
| 48 | 48 | |
| 49 | 49 | list($database, $hostname, $username, $password) = $this->parseConfiguration($configuration); |
| 50 | 50 | |
| 51 | 51 | if (in_array($driverName, $mysql)) { |
| 52 | - $dsn = 'mysql:host=' . $hostname . ';dbname=' . $database; |
|
| 52 | + $dsn = 'mysql:host='.$hostname.';dbname='.$database; |
|
| 53 | 53 | $pdo = new \PDO($dsn, $username, $password); |
| 54 | 54 | |
| 55 | 55 | return new MySQLDriver($pdo, $database); |
@@ -109,6 +109,6 @@ discard block |
||
| 109 | 109 | } |
| 110 | 110 | } |
| 111 | 111 | |
| 112 | - return [ $database, $hostname, $username, $password ]; |
|
| 112 | + return [$database, $hostname, $username, $password]; |
|
| 113 | 113 | } |
| 114 | 114 | } |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | { |
| 38 | 38 | $columns = []; |
| 39 | 39 | |
| 40 | - $query = $this->pdo->prepare('PRAGMA table_info("' . $table . '");'); |
|
| 40 | + $query = $this->pdo->prepare('PRAGMA table_info("'.$table.'");'); |
|
| 41 | 41 | |
| 42 | 42 | $query->execute(); |
| 43 | 43 | $query->setFetchMode(\PDO::FETCH_OBJ); |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | */ |
| 110 | 110 | protected function prepareForeignColumns(array $columns, $tableName) |
| 111 | 111 | { |
| 112 | - $query = $this->pdo->prepare('PRAGMA foreign_key_list("' . $tableName . '");'); |
|
| 112 | + $query = $this->pdo->prepare('PRAGMA foreign_key_list("'.$tableName.'");'); |
|
| 113 | 113 | |
| 114 | 114 | $query->execute(); |
| 115 | 115 | $query->setFetchMode(\PDO::FETCH_OBJ); |
@@ -128,9 +128,9 @@ discard block |
||
| 128 | 128 | * @param \Rougin\Describe\Column &$column |
| 129 | 129 | * @return void |
| 130 | 130 | */ |
| 131 | - protected function setProperties($row, Column &$column) |
|
| 131 | + protected function setProperties($row, Column & $column) |
|
| 132 | 132 | { |
| 133 | - if (! $row->notnull) { |
|
| 133 | + if ( ! $row->notnull) { |
|
| 134 | 134 | $column->setNull(true); |
| 135 | 135 | } |
| 136 | 136 | |
@@ -65,7 +65,7 @@ |
||
| 65 | 65 | $table = $this->driver->getTable($tableName); |
| 66 | 66 | |
| 67 | 67 | if (empty($table) || is_null($table)) { |
| 68 | - $message = '"' . $tableName . '" table not found in database!'; |
|
| 68 | + $message = '"'.$tableName.'" table not found in database!'; |
|
| 69 | 69 | |
| 70 | 70 | throw new Exceptions\TableNameNotFoundException($message); |
| 71 | 71 | } |
@@ -211,8 +211,8 @@ |
||
| 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 | |