@@ -104,7 +104,7 @@ |
||
104 | 104 | /** |
105 | 105 | * @param string $sql |
106 | 106 | * @param iterable $data |
107 | - * @param $callback |
|
107 | + * @param callable $callback |
|
108 | 108 | * |
109 | 109 | * @return bool |
110 | 110 | */ |
@@ -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){ |
@@ -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 |
@@ -86,7 +86,7 @@ |
||
86 | 86 | } |
87 | 87 | |
88 | 88 | /** |
89 | - * @param $result |
|
89 | + * @param resource $result |
|
90 | 90 | * @param string|null $index |
91 | 91 | * @param bool $assoc |
92 | 92 | * |
@@ -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'].')'; |
@@ -24,6 +24,7 @@ |
||
24 | 24 | * @param \chillerlan\Database\Drivers\DriverInterface $db |
25 | 25 | * @param \chillerlan\Database\Dialects\Dialect $dialect |
26 | 26 | * @param \Psr\Log\LoggerInterface|null $logger |
27 | + * @return void |
|
27 | 28 | */ |
28 | 29 | public function __construct(DriverInterface $db, Dialect $dialect, LoggerInterface $logger = null); |
29 | 30 |
@@ -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 |
@@ -22,6 +22,7 @@ |
||
22 | 22 | * @param iterable|null $data |
23 | 23 | * @param string|null $sourceEncoding |
24 | 24 | * @param string $destEncoding |
25 | + * @return void |
|
25 | 26 | */ |
26 | 27 | public function __construct(iterable $data = null, string $sourceEncoding = null, string $destEncoding = null); |
27 | 28 |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | elseif(in_array(strtolower($val2), ['null', 'false', 'true', 'unknown'], true)){ |
100 | 100 | $where[] = strtoupper($val2); |
101 | 101 | } |
102 | - else { |
|
102 | + else{ |
|
103 | 103 | |
104 | 104 | if($bind){ |
105 | 105 | $where[] = '?'; |
@@ -158,9 +158,9 @@ discard block |
||
158 | 158 | $where = []; |
159 | 159 | |
160 | 160 | foreach($this->where as $k => $v){ |
161 | - $last = $this->where[$k-1] ?? false; |
|
161 | + $last = $this->where[$k - 1] ?? false; |
|
162 | 162 | |
163 | - if(in_array($v, $this->joinArgs + ['(', ')'], true)){ |
|
163 | + if(in_array($v, $this->joinArgs + ['(', ')'], true)){ |
|
164 | 164 | $where[] = $v; |
165 | 165 | |
166 | 166 | continue; |
@@ -99,7 +99,7 @@ |
||
99 | 99 | elseif(in_array(strtolower($val2), ['null', 'false', 'true', 'unknown'], true)){ |
100 | 100 | $where[] = strtoupper($val2); |
101 | 101 | } |
102 | - else { |
|
102 | + else{ |
|
103 | 103 | |
104 | 104 | if($bind){ |
105 | 105 | $where[] = '?'; |
@@ -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 | } |
@@ -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); |