@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | * |
51 | 51 | * @param string $dbName Database name |
52 | 52 | * |
53 | - * @return boolean |
|
53 | + * @return boolean|null |
|
54 | 54 | * @throws \InvalidArgumentException |
55 | 55 | */ |
56 | 56 | public function switchDatabase($dbName) |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | * @param array $elements Elements to update |
222 | 222 | * @param string $conditions Conditions for search |
223 | 223 | * |
224 | - * @return bool |
|
224 | + * @return boolean|null |
|
225 | 225 | */ |
226 | 226 | public function update($table, array $elements = [], $conditions = '') |
227 | 227 | { |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | * @param string $conditions Conditions to search |
238 | 238 | * @param array $params Params array |
239 | 239 | * |
240 | - * @return bool |
|
240 | + * @return boolean|null |
|
241 | 241 | */ |
242 | 242 | public function delete($table, $conditions, array $params = []) |
243 | 243 | { |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | * @param string $table Table name |
268 | 268 | * @param array $params Params array |
269 | 269 | * |
270 | - * @return bool |
|
270 | + * @return boolean|null |
|
271 | 271 | */ |
272 | 272 | public function exists($table, array $params = []) |
273 | 273 | { |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | public function listTables() |
82 | 82 | { |
83 | 83 | return $this->conn->query( |
84 | - 'SELECT table_name FROM information_schema.tables WHERE table_schema = \'' . $this->tableSchema . '\'' |
|
84 | + 'SELECT table_name FROM information_schema.tables WHERE table_schema = \''.$this->tableSchema.'\'' |
|
85 | 85 | )->fetchAll(\PDO::FETCH_COLUMN, 0); |
86 | 86 | } |
87 | 87 | |
@@ -149,13 +149,13 @@ discard block |
||
149 | 149 | */ |
150 | 150 | public function listFields($table) |
151 | 151 | { |
152 | - $sth = $this->conn->query('SELECT * FROM information_schema.columns WHERE table_name =\'' . $table . '\''); |
|
152 | + $sth = $this->conn->query('SELECT * FROM information_schema.columns WHERE table_name =\''.$table.'\''); |
|
153 | 153 | $result = []; |
154 | 154 | |
155 | 155 | foreach ($sth->fetchAll(\PDO::FETCH_ASSOC) as $row) { |
156 | 156 | $result[] = [ |
157 | 157 | 'field' => $row['column_name'], |
158 | - 'type' => $row['data_type'] . (($max = $row['character_maximum_length']) ? '(' . $max . ')' : ''), |
|
158 | + 'type' => $row['data_type'].(($max = $row['character_maximum_length']) ? '('.$max.')' : ''), |
|
159 | 159 | 'null' => $row['is_nullable'], |
160 | 160 | 'default' => $row['column_default'] |
161 | 161 | ]; |
@@ -192,8 +192,8 @@ discard block |
||
192 | 192 | */ |
193 | 193 | public function insert($table, array $line = [], $multi = false) |
194 | 194 | { |
195 | - $fields = '"' . implode('", "', array_keys($multi ? $line[0] : $line)) . '"'; |
|
196 | - $values = ':' . implode(', :', array_keys($multi ? $line[0] : $line)); |
|
195 | + $fields = '"'.implode('", "', array_keys($multi ? $line[0] : $line)).'"'; |
|
196 | + $values = ':'.implode(', :', array_keys($multi ? $line[0] : $line)); |
|
197 | 197 | $rows = $multi ? $line : [$line]; |
198 | 198 | $id = null; |
199 | 199 |