@@ -52,7 +52,7 @@ |
||
| 52 | 52 | * Firebird -> SQLSTATE[IM001]: driver does not support lastInsertId() |
| 53 | 53 | * |
| 54 | 54 | * @link http://php.net/manual/pdo.lastinsertid.php |
| 55 | - * @return null |
|
| 55 | + * @return string |
|
| 56 | 56 | */ |
| 57 | 57 | protected function insertID():string { |
| 58 | 58 | return null; |
@@ -191,10 +191,10 @@ discard block |
||
| 191 | 191 | * @return array |
| 192 | 192 | * @internal |
| 193 | 193 | */ |
| 194 | - protected function getResult(PDOStatement &$stmt, string $index, bool $assoc, bool $fetch_array):array { |
|
| 194 | + protected function getResult(PDOStatement&$stmt, string $index, bool $assoc, bool $fetch_array):array { |
|
| 195 | 195 | $out = []; |
| 196 | 196 | $method = $assoc ? ($fetch_array ? PDO::FETCH_ASSOC : PDO::FETCH_OBJ) : PDO::FETCH_NUM; |
| 197 | - $i = 0 ; |
|
| 197 | + $i = 0; |
|
| 198 | 198 | |
| 199 | 199 | // ok, we have a result with one or more rows, loop out the rows and output as array |
| 200 | 200 | while($row = $stmt->fetch($method)){ |
@@ -225,16 +225,16 @@ discard block |
||
| 225 | 225 | * @return void |
| 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); |
@@ -58,7 +58,7 @@ |
||
| 58 | 58 | * |
| 59 | 59 | * @return array stats |
| 60 | 60 | */ |
| 61 | - public function getStats():array ; |
|
| 61 | + public function getStats():array; |
|
| 62 | 62 | |
| 63 | 63 | /** |
| 64 | 64 | * Enables query stat recording |
@@ -32,7 +32,7 @@ |
||
| 32 | 32 | * @return resource the database resource object |
| 33 | 33 | * @throws \chillerlan\Database\DBException |
| 34 | 34 | */ |
| 35 | - public function connect() { |
|
| 35 | + public function connect(){ |
|
| 36 | 36 | |
| 37 | 37 | if(gettype($this->db) === 'resource'){ |
| 38 | 38 | return $this->db; |
@@ -32,7 +32,7 @@ |
||
| 32 | 32 | * @return resource the database resource object |
| 33 | 33 | * @throws \chillerlan\Database\DBException |
| 34 | 34 | */ |
| 35 | - public function connect() { |
|
| 35 | + public function connect(){ |
|
| 36 | 36 | |
| 37 | 37 | if(gettype($this->db) === 'resource'){ |
| 38 | 38 | return $this->db; |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | |
| 187 | 187 | $out = []; |
| 188 | 188 | $method = 'fetch_'.($assoc ? ($fetch_array ? 'assoc' : 'object') : 'row'); |
| 189 | - $i = 0 ; |
|
| 189 | + $i = 0; |
|
| 190 | 190 | |
| 191 | 191 | // ok, we have a result with one or more rows, loop out the rows and output as array |
| 192 | 192 | while($row = $result->{$method}()){ |
@@ -352,7 +352,7 @@ discard block |
||
| 352 | 352 | * |
| 353 | 353 | * @return void |
| 354 | 354 | */ |
| 355 | - protected function insertPreparedRow(mysqli_stmt &$stmt, ReflectionMethod &$reflectionMethod, array &$row){ |
|
| 355 | + protected function insertPreparedRow(mysqli_stmt&$stmt, ReflectionMethod&$reflectionMethod, array &$row){ |
|
| 356 | 356 | $references = $this->getReferences($row); |
| 357 | 357 | array_unshift($references, $this->getTypes($references)); |
| 358 | 358 | $reflectionMethod->invokeArgs($stmt, $references); |
@@ -370,7 +370,7 @@ discard block |
||
| 370 | 370 | * |
| 371 | 371 | * @return array|bool |
| 372 | 372 | */ |
| 373 | - protected function getResult(mysqli_stmt &$stmt, mysqli_result &$result, string $index, bool $assoc, bool $fetch_array){ |
|
| 373 | + protected function getResult(mysqli_stmt&$stmt, mysqli_result&$result, string $index, bool $assoc, bool $fetch_array){ |
|
| 374 | 374 | // get the columns and their references |
| 375 | 375 | // http://php.net/manual/mysqli-stmt.bind-result.php |
| 376 | 376 | $cols = $refs = []; |
@@ -426,7 +426,7 @@ discard block |
||
| 426 | 426 | foreach($values as &$v){ |
| 427 | 427 | switch(gettype($v)){ |
| 428 | 428 | case 'integer': $types[] = 'i'; break; |
| 429 | - case 'double': $types[] ='d'; break; |
|
| 429 | + case 'double': $types[] = 'd'; break; |
|
| 430 | 430 | default: $types[] = 's'; break; |
| 431 | 431 | } |
| 432 | 432 | } |