@@ -168,7 +168,7 @@ |
||
| 168 | 168 | * @param string $sql The SQL statement to prepare |
| 169 | 169 | * @param array $values a multidimensional array with the values, each row represents one line to insert. |
| 170 | 170 | * |
| 171 | - * @return bool true query success, otherwise false |
|
| 171 | + * @return boolean|null true query success, otherwise false |
|
| 172 | 172 | */ |
| 173 | 173 | public function multi($sql, array $values){ |
| 174 | 174 | // TODO: Implement multi() method. |
@@ -86,6 +86,7 @@ |
||
| 86 | 86 | * |
| 87 | 87 | * @param array $stats |
| 88 | 88 | * @internal |
| 89 | + * @return void |
|
| 89 | 90 | */ |
| 90 | 91 | public function addStats(array $stats); |
| 91 | 92 | |
@@ -168,7 +168,7 @@ |
||
| 168 | 168 | * @param string $sql The SQL statement to prepare |
| 169 | 169 | * @param array $values a multidimensional array with the values, each row represents one line to insert. |
| 170 | 170 | * |
| 171 | - * @return bool true query success, otherwise false |
|
| 171 | + * @return boolean|null true query success, otherwise false |
|
| 172 | 172 | */ |
| 173 | 173 | public function multi($sql, array $values){ |
| 174 | 174 | // TODO: Implement multi() method. |
@@ -26,7 +26,7 @@ |
||
| 26 | 26 | * @param string $class FQCN |
| 27 | 27 | * @param string $interface FQCN |
| 28 | 28 | * |
| 29 | - * @param mixed $params [optional] the following arguments are optional and will be passed to the class constructor if present. |
|
| 29 | + * @param \chillerlan\Database\DBOptions $params [optional] the following arguments are optional and will be passed to the class constructor if present. |
|
| 30 | 30 | * |
| 31 | 31 | * @return object of type $interface |
| 32 | 32 | * @throws \chillerlan\Database\DBException |
@@ -36,7 +36,7 @@ |
||
| 36 | 36 | if(class_exists($class)){ |
| 37 | 37 | $reflectionClass = new ReflectionClass($class); |
| 38 | 38 | |
| 39 | - if(!$reflectionClass->implementsInterface($interface)) { |
|
| 39 | + if(!$reflectionClass->implementsInterface($interface)){ |
|
| 40 | 40 | throw new DBException($class.' does not implement '.$interface); |
| 41 | 41 | } |
| 42 | 42 | |
@@ -129,7 +129,7 @@ |
||
| 129 | 129 | * |
| 130 | 130 | * @var int |
| 131 | 131 | */ |
| 132 | - public $sqlite_flags = SQLITE3_OPEN_READWRITE | SQLITE3_OPEN_CREATE; |
|
| 132 | + public $sqlite_flags = SQLITE3_OPEN_READWRITE|SQLITE3_OPEN_CREATE; |
|
| 133 | 133 | /** |
| 134 | 134 | * An optional encryption key used when encrypting and decrypting an SQLite database. |
| 135 | 135 | * |
@@ -181,7 +181,7 @@ |
||
| 181 | 181 | if(!is_bool($result)){ |
| 182 | 182 | $out = []; |
| 183 | 183 | $method = 'fetch_'.($assoc ? ($fetch_array ? 'assoc' : 'object') : 'row'); |
| 184 | - $i = 0 ; |
|
| 184 | + $i = 0; |
|
| 185 | 185 | |
| 186 | 186 | // ok, we have a result with one or more rows, loop out the rows and output as array |
| 187 | 187 | while($row = $result->{$method}()){ |
@@ -192,10 +192,10 @@ discard block |
||
| 192 | 192 | * @return array |
| 193 | 193 | * @internal |
| 194 | 194 | */ |
| 195 | - protected function getResult(PDOStatement &$stmt, $index, $assoc, $fetch_array){ |
|
| 195 | + protected function getResult(PDOStatement&$stmt, $index, $assoc, $fetch_array){ |
|
| 196 | 196 | $out = []; |
| 197 | 197 | $method = $assoc ? ($fetch_array ? PDO::FETCH_ASSOC : PDO::FETCH_OBJ) : PDO::FETCH_NUM; |
| 198 | - $i = 0 ; |
|
| 198 | + $i = 0; |
|
| 199 | 199 | |
| 200 | 200 | // ok, we have a result with one or more rows, loop out the rows and output as array |
| 201 | 201 | while($row = $stmt->fetch($method)){ |
@@ -225,16 +225,16 @@ discard block |
||
| 225 | 225 | * @param array $values |
| 226 | 226 | * @internal |
| 227 | 227 | */ |
| 228 | - protected function bindParams(PDOStatement &$stmt, array $values){ |
|
| 228 | + protected function bindParams(PDOStatement&$stmt, array $values){ |
|
| 229 | 229 | $param_no = 1; |
| 230 | 230 | |
| 231 | 231 | foreach($values as $v){ |
| 232 | 232 | |
| 233 | 233 | switch(gettype($v)){ |
| 234 | 234 | case 'boolean': $type = PDO::PARAM_BOOL; break; |
| 235 | - case 'integer': $type = PDO::PARAM_INT; break; |
|
| 235 | + case 'integer': $type = PDO::PARAM_INT; break; |
|
| 236 | 236 | case 'NULL': $type = PDO::PARAM_NULL; break; |
| 237 | - default: $type = PDO::PARAM_STR; break; |
|
| 237 | + default: $type = PDO::PARAM_STR; break; |
|
| 238 | 238 | } |
| 239 | 239 | |
| 240 | 240 | $stmt->bindValue($param_no, $v, $type); |
@@ -39,15 +39,15 @@ |
||
| 39 | 39 | public function driverDataProvider(){ |
| 40 | 40 | return [ |
| 41 | 41 | // native |
| 42 | - ['MYSQLI', MySQLiDriver::class, 'mysqli'], |
|
| 43 | - ['POSTGRESQL', PostgreSQLDriver::class, 'resource'], |
|
| 44 | - ['SQLITE3', SQLite3Driver::class, 'SQLite3'], |
|
| 42 | + ['MYSQLI', MySQLiDriver::class, 'mysqli'], |
|
| 43 | + ['POSTGRESQL', PostgreSQLDriver::class, 'resource'], |
|
| 44 | + ['SQLITE3', SQLite3Driver::class, 'SQLite3'], |
|
| 45 | 45 | |
| 46 | 46 | // PDO (obviously) |
| 47 | - ['PDO_MYSQL', PDOMySQLDriver::class, 'PDO'], |
|
| 47 | + ['PDO_MYSQL', PDOMySQLDriver::class, 'PDO'], |
|
| 48 | 48 | ['PDO_POSTGRES', PDOPostgresDriver::class, 'PDO'], |
| 49 | 49 | # ['PDO_FIREBIRD', PDOFirebirdDriver::class, 'PDO'], // https://github.com/asfernandes/firebird/blob/master/.travis.yml |
| 50 | - ['PDO_SQLITE', PDOSQLiteDriver::class, 'PDO'], |
|
| 50 | + ['PDO_SQLITE', PDOSQLiteDriver::class, 'PDO'], |
|
| 51 | 51 | ]; |
| 52 | 52 | } |
| 53 | 53 | |