Completed
Push — master ( 319aa4...523298 )
by smiley
04:24
created
tests/DBInstanceTest.php 2 patches
Unused Use Statements   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -9,15 +9,14 @@
 block discarded – undo
9 9
 
10 10
 namespace chillerlan\DatabaseTest;
11 11
 
12
+use Dotenv\Dotenv;
12 13
 use chillerlan\Database\DBOptions;
13 14
 use chillerlan\Database\Drivers\MySQLi\MySQLiDriver;
14
-use chillerlan\Database\Drivers\PDO\PDOFirebirdDriver;
15 15
 use chillerlan\Database\Drivers\PDO\PDOMySQLDriver;
16 16
 use chillerlan\Database\Drivers\PDO\PDOPostgresDriver;
17 17
 use chillerlan\Database\Drivers\PDO\PDOSQLiteDriver;
18 18
 use chillerlan\Database\Drivers\PostgreSQL\PostgreSQLDriver;
19 19
 use chillerlan\Database\Drivers\SQLite\SQLite3Driver;
20
-use Dotenv\Dotenv;
21 20
 
22 21
 class DBInstanceTest extends \PHPUnit_Framework_TestCase{
23 22
 
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -39,15 +39,15 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/Drivers/PDO/PDODriver.php 2 patches
Unused Use Statements   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -11,11 +11,11 @@
 block discarded – undo
11 11
 
12 12
 namespace chillerlan\Database\Drivers\PDO;
13 13
 
14
-use chillerlan\Database\DBException;
15
-use chillerlan\Database\Drivers\DBDriverAbstract;
16 14
 use PDO;
17 15
 use PDOException;
18 16
 use PDOStatement;
17
+use chillerlan\Database\DBException;
18
+use chillerlan\Database\Drivers\DBDriverAbstract;
19 19
 
20 20
 /**
21 21
  * Class PDODriver
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -191,10 +191,10 @@  discard block
 block discarded – undo
191 191
 	 * @return array
192 192
 	 * @internal
193 193
 	 */
194
-	protected function getResult(PDOStatement &$stmt, string $index = null, bool $assoc, bool $fetch_array):array {
194
+	protected function getResult(PDOStatement&$stmt, string $index = null, 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
 block discarded – undo
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);
Please login to merge, or discard this patch.
src/Drivers/SQLite/SQLite3Driver.php 1 patch
Unused Use Statements   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -12,10 +12,10 @@
 block discarded – undo
12 12
 
13 13
 namespace chillerlan\Database\Drivers\SQLite;
14 14
 
15
-use chillerlan\Database\DBException;
16
-use chillerlan\Database\Drivers\DBDriverAbstract;
17 15
 use Exception;
18 16
 use SQLite3;
17
+use chillerlan\Database\DBException;
18
+use chillerlan\Database\Drivers\DBDriverAbstract;
19 19
 
20 20
 /**
21 21
  *
Please login to merge, or discard this patch.
src/DBResult.php 1 patch
Unused Use Statements   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,9 @@
 block discarded – undo
12 12
 
13 13
 namespace chillerlan\Database;
14 14
 
15
-use ArrayAccess, Countable, Iterator;
15
+use ArrayAccess;
16
+use Countable;
17
+use Iterator;
16 18
 use chillerlan\Database\Traits\{Enumerable, Magic};
17 19
 
18 20
 /**
Please login to merge, or discard this patch.
src/Drivers/DBDriverAbstract.php 1 patch
Unused Use Statements   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,10 +10,10 @@
 block discarded – undo
10 10
 
11 11
 namespace chillerlan\Database\Drivers;
12 12
 
13
+use Psr\SimpleCache\CacheInterface;
13 14
 use chillerlan\Database\DBException;
14 15
 use chillerlan\Database\DBOptions;
15 16
 use chillerlan\Database\DBResult;
16
-use Psr\SimpleCache\CacheInterface;
17 17
 
18 18
 /**
19 19
  * Class DBDriverAbstract
Please login to merge, or discard this patch.
src/Drivers/MySQLiDriver.php 2 patches
Unused Use Statements   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -12,10 +12,12 @@
 block discarded – undo
12 12
 
13 13
 namespace chillerlan\Database\Drivers;
14 14
 
15
+use ReflectionMethod;
15 16
 use chillerlan\Database\DBException;
16 17
 use chillerlan\Database\DBResult;
17
-use mysqli, mysqli_result, mysqli_sql_exception, mysqli_stmt;
18
-use ReflectionMethod, stdClass, Exception;
18
+use mysqli;
19
+use mysqli_result;
20
+use mysqli_stmt;
19 21
 
20 22
 /**
21 23
  *
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -263,7 +263,7 @@
 block discarded – undo
263 263
 	 *
264 264
 	 * @return void
265 265
 	 */
266
-	protected function insertPreparedRow(mysqli_stmt &$stmt, ReflectionMethod &$reflectionMethod, array &$row){
266
+	protected function insertPreparedRow(mysqli_stmt&$stmt, ReflectionMethod&$reflectionMethod, array &$row){
267 267
 		$reflectionMethod->invokeArgs($stmt, $this->getReferences($row));
268 268
 		$stmt->execute();
269 269
 	}
Please login to merge, or discard this patch.
src/Drivers/PDO/PDODriverAbstract.php 2 patches
Unused Use Statements   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -11,12 +11,12 @@
 block discarded – undo
11 11
 
12 12
 namespace chillerlan\Database\Drivers\PDO;
13 13
 
14
-use chillerlan\Database\DBException;
15
-use chillerlan\Database\Drivers\DBDriverAbstract;
16
-use chillerlan\Database\Drivers\DBDriverInterface;
17 14
 use PDO;
18 15
 use PDOException;
19 16
 use PDOStatement;
17
+use chillerlan\Database\DBException;
18
+use chillerlan\Database\Drivers\DBDriverAbstract;
19
+use chillerlan\Database\Drivers\DBDriverInterface;
20 20
 
21 21
 /**
22 22
  * Class PDODriverAbstract
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -163,7 +163,7 @@
 block discarded – undo
163 163
 	 *
164 164
 	 * @return void
165 165
 	 */
166
-	protected function bindParams(PDOStatement &$stmt, array $values){
166
+	protected function bindParams(PDOStatement&$stmt, array $values){
167 167
 		$param_no = 1;
168 168
 
169 169
 		foreach($values as $v){
Please login to merge, or discard this patch.
src/DBOptions.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -129,7 +129,7 @@
 block discarded – undo
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
 	/**
135 135
 	 * An optional encryption key used when encrypting and decrypting an SQLite database.
Please login to merge, or discard this patch.
src/DBResultRow.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@
 block discarded – undo
43 43
 	 *
44 44
 	 * @return mixed|null
45 45
 	 */
46
-	public function __get(string $name) {
46
+	public function __get(string $name){
47 47
 
48 48
 		if(isset($this->array[$name])){
49 49
 			return $this->array[$name];
Please login to merge, or discard this patch.