Passed
Push — master ( d58ab5...7f0dd2 )
by Richard
01:40
created
maphper/datasource/sqliteadapter.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 	}
45 45
 
46 46
 	private function tableExists($name) {
47
-		$result = $this->pdo->query('SELECT name FROM sqlite_master WHERE type="table" and name="'. $name.'"');
47
+		$result = $this->pdo->query('SELECT name FROM sqlite_master WHERE type="table" and name="' . $name . '"');
48 48
 		return count($result->fetchAll()) == 1;
49 49
 	}
50 50
 
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 		// SQLSTATE[HY000]: General error: 17 database schema has changed
64 64
 		$this->stmtCache->clearCache();
65 65
 
66
-		$affix = '_'.substr(md5($table), 0, 6);
66
+		$affix = '_' . substr(md5($table), 0, 6);
67 67
 		$this->createTable($table . $affix, $primaryKey, $data);
68 68
 		$fields = [];
69 69
 		foreach ($data as $key => $value) { $fields[] = $key; }
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 				$columns = implode(', ', $this->getColumns($table));			
73 73
 
74 74
 				$this->pdo->query('INSERT INTO ' . $this->quote($table . $affix) . '(' . $columns . ') SELECT ' . $columns . ' FROM ' . $this->quote($table));
75
-				$this->pdo->query('DROP TABLE IF EXISTS ' . $table );
75
+				$this->pdo->query('DROP TABLE IF EXISTS ' . $table);
76 76
 			}
77 77
 		}
78 78
 		catch (\PDOException $e) {
@@ -80,8 +80,8 @@  discard block
 block discarded – undo
80 80
 			echo $e->getMessage();
81 81
 		}
82 82
 
83
-		$this->pdo->query('DROP TABLE IF EXISTS ' . $table );
84
-		$this->pdo->query('ALTER TABLE ' . $table . $affix. ' RENAME TO '. $table );
83
+		$this->pdo->query('DROP TABLE IF EXISTS ' . $table);
84
+		$this->pdo->query('ALTER TABLE ' . $table . $affix . ' RENAME TO ' . $table);
85 85
 
86 86
 	}
87 87
 
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 		
96 96
 		$pkField = implode(', ', $parts) . ', PRIMARY KEY(' . implode(', ', $primaryKey) . ')';
97 97
 				
98
-		$this->pdo->query('DROP TABLE IF EXISTS ' . $table );
98
+		$this->pdo->query('DROP TABLE IF EXISTS ' . $table);
99 99
 		$this->pdo->query('CREATE TABLE ' . $table . ' (' . $pkField . ')');
100 100
 					
101 101
 		foreach ($data as $key => $value) {
Please login to merge, or discard this patch.