@@ -12,9 +12,9 @@ |
||
| 12 | 12 | |
| 13 | 13 | namespace chillerlan\Database\Drivers; |
| 14 | 14 | |
| 15 | +use Exception; |
|
| 15 | 16 | use chillerlan\Database\Dialects\MySQL; |
| 16 | 17 | use chillerlan\Database\Result; |
| 17 | -use Exception; |
|
| 18 | 18 | use mysqli; |
| 19 | 19 | |
| 20 | 20 | /** |
@@ -12,7 +12,8 @@ |
||
| 12 | 12 | |
| 13 | 13 | namespace chillerlan\Database\Drivers; |
| 14 | 14 | |
| 15 | -use PDO, PDOStatement; |
|
| 15 | +use PDO; |
|
| 16 | +use PDOStatement; |
|
| 16 | 17 | |
| 17 | 18 | /** |
| 18 | 19 | * @property \PDO $db |
@@ -121,7 +121,7 @@ |
||
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 | /** @inheritdoc */ |
| 124 | - public function getServerInfo():?string{ |
|
| 124 | + public function getServerInfo(): ?string{ |
|
| 125 | 125 | return $this->db->getAttribute(PDO::ATTR_SERVER_INFO); |
| 126 | 126 | } |
| 127 | 127 | |
@@ -12,9 +12,9 @@ |
||
| 12 | 12 | |
| 13 | 13 | namespace chillerlan\Database\Query; |
| 14 | 14 | |
| 15 | +use Psr\Log\LoggerInterface; |
|
| 15 | 16 | use chillerlan\Database\Dialects\Dialect; |
| 16 | 17 | use chillerlan\Database\Drivers\DriverInterface; |
| 17 | -use Psr\Log\LoggerInterface; |
|
| 18 | 18 | |
| 19 | 19 | interface Statement{ |
| 20 | 20 | |
@@ -550,8 +550,8 @@ |
||
| 550 | 550 | : $this->dialect->quote($k).' = '.$v; //$this->db->escape($v) |
| 551 | 551 | } |
| 552 | 552 | else{ |
| 553 | - $this->set[] = $this->dialect->quote($k).' = ?'; |
|
| 554 | - $this->addBindValue($k, is_bool($v) ? (int)$v : $v);// avoid errors with PDO firebird & mysql |
|
| 553 | + $this->set[] = $this->dialect->quote($k).' = ?'; |
|
| 554 | + $this->addBindValue($k, is_bool($v) ? (int)$v : $v); // avoid errors with PDO firebird & mysql |
|
| 555 | 555 | } |
| 556 | 556 | } |
| 557 | 557 | } |
@@ -74,7 +74,7 @@ |
||
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | /** @inheritdoc */ |
| 77 | - public function getServerInfo():?string{ |
|
| 77 | + public function getServerInfo(): ?string{ |
|
| 78 | 78 | $ver = pg_version($this->db); |
| 79 | 79 | |
| 80 | 80 | return 'PostgreSQL '.$ver['server'].' ('.$ver['server_encoding'].', date style: '.$ver['DateStyle'].', time zone: '.$ver['TimeZone'].')'; |
@@ -168,7 +168,7 @@ |
||
| 168 | 168 | } |
| 169 | 169 | |
| 170 | 170 | /** @inheritdoc */ |
| 171 | - public function getServerInfo():?string{ |
|
| 171 | + public function getServerInfo(): ?string{ |
|
| 172 | 172 | |
| 173 | 173 | if(gettype($this->db) === 'resource'){ |
| 174 | 174 | $info = sqlsrv_server_info($this->db); |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | // @todo |
| 41 | 41 | $this->pdo_options[PDO::SQLSRV_ATTR_QUERY_TIMEOUT] = $options->mssql_timeout; // doesn't seem to have an effect |
| 42 | 42 | $this->pdo_options[PDO::SQLSRV_ATTR_FETCHES_NUMERIC_TYPE] = true; |
| 43 | - $this->pdo_options[PDO::SQLSRV_ATTR_ENCODING ] = PDO::SQLSRV_ENCODING_UTF8; |
|
| 43 | + $this->pdo_options[PDO::SQLSRV_ATTR_ENCODING] = PDO::SQLSRV_ENCODING_UTF8; |
|
| 44 | 44 | |
| 45 | 45 | parent::__construct($options, $cache); |
| 46 | 46 | } |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | $dsn .= ':Server='.$this->options->host; |
| 53 | 53 | |
| 54 | 54 | if(is_numeric($this->options->port)){ |
| 55 | - $dsn .= ','.$this->options->port; |
|
| 55 | + $dsn .= ','.$this->options->port; |
|
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | $dsn .= ';Database='.$this->options->database; |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | /** @inheritdoc */ |
| 75 | - public function getServerInfo():?string{ |
|
| 75 | + public function getServerInfo(): ?string{ |
|
| 76 | 76 | $info = $this->db->getAttribute(PDO::ATTR_SERVER_INFO); |
| 77 | 77 | |
| 78 | 78 | if(is_array($info) && !empty($info)){ |
@@ -12,9 +12,9 @@ |
||
| 12 | 12 | |
| 13 | 13 | namespace chillerlan\Database\Drivers; |
| 14 | 14 | |
| 15 | +use PDO; |
|
| 15 | 16 | use chillerlan\Database\Dialects\MSSQL; |
| 16 | 17 | use chillerlan\Settings\SettingsContainerInterface; |
| 17 | -use PDO; |
|
| 18 | 18 | use Psr\{ |
| 19 | 19 | Log\LoggerInterface, SimpleCache\CacheInterface |
| 20 | 20 | }; |
@@ -69,7 +69,7 @@ |
||
| 69 | 69 | * |
| 70 | 70 | * @return string serverinfo string |
| 71 | 71 | */ |
| 72 | - public function getServerInfo():?string; |
|
| 72 | + public function getServerInfo(): ?string; |
|
| 73 | 73 | |
| 74 | 74 | /** |
| 75 | 75 | * Sanitizer. |
@@ -12,10 +12,10 @@ |
||
| 12 | 12 | |
| 13 | 13 | namespace chillerlan\Database\Drivers; |
| 14 | 14 | |
| 15 | -use chillerlan\Database\Dialects\Dialect; |
|
| 16 | -use chillerlan\Settings\SettingsContainerInterface; |
|
| 17 | 15 | use Psr\Log\LoggerInterface; |
| 18 | 16 | use Psr\SimpleCache\CacheInterface; |
| 17 | +use chillerlan\Database\Dialects\Dialect; |
|
| 18 | +use chillerlan\Settings\SettingsContainerInterface; |
|
| 19 | 19 | |
| 20 | 20 | interface DriverInterface{ |
| 21 | 21 | |
@@ -175,7 +175,7 @@ |
||
| 175 | 175 | $sql, |
| 176 | 176 | $values !== null ? $values : [], |
| 177 | 177 | $index, |
| 178 | - $assoc !== null ? $assoc : true |
|
| 178 | + $assoc !== null ? $assoc : true |
|
| 179 | 179 | ); |
| 180 | 180 | } |
| 181 | 181 | catch(\Exception $e){ |