Passed
Push — master ( c6058f...e9743f )
by Richard
04:06
created
maphper/datasource/mysqladapter.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
 	public function query(\Maphper\Lib\Query $query) {
28 28
 		$stmt = $this->getCachedStmt($query->getSql());
29 29
 		$args = $query->getArgs();
30
-        $stmt->execute($args);
30
+		$stmt->execute($args);
31 31
 
32 32
 		if (strpos(trim($query->getSql()), 'SELECT') === 0) return $stmt->fetchAll(\PDO::FETCH_OBJ);
33 33
 		else return $stmt;
Please login to merge, or discard this patch.
maphper/datasource/sqliteadapter.php 1 patch
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
 		return '`' . str_replace('.', '`.`', trim($str, '`')) . '`';
14 14
 	}
15 15
 
16
-    private function getCachedStmt($sql) {
16
+	private function getCachedStmt($sql) {
17 17
 		$queryId = md5($sql);
18 18
 		if (isset($this->queryCache[$queryId])) $stmt = $this->queryCache[$queryId];
19 19
 		else {
@@ -25,20 +25,20 @@  discard block
 block discarded – undo
25 25
 
26 26
 	public function query(\Maphper\Lib\Query $query) {
27 27
 		$queryId = md5($query->getSql());
28
-        $stmt = $this->getCachedStmt($query->getSql());
28
+		$stmt = $this->getCachedStmt($query->getSql());
29 29
 		$args = $query->getArgs();
30 30
 
31
-        //Handle SQLite when PDO_ERRMODE is set to SILENT
32
-        if ($stmt === false) throw new \Exception('Invalid query');
31
+		//Handle SQLite when PDO_ERRMODE is set to SILENT
32
+		if ($stmt === false) throw new \Exception('Invalid query');
33 33
 
34
-        $stmt->execute($args);
35
-        if ($stmt->errorCode() !== '00000' && $stmt->errorInfo()[2] == 'database schema has changed') {
34
+		$stmt->execute($args);
35
+		if ($stmt->errorCode() !== '00000' && $stmt->errorInfo()[2] == 'database schema has changed') {
36 36
 			unset($this->queryCache[$queryId]);
37 37
 			return $this->query($query);
38
-        }
38
+		}
39 39
 
40
-        if (substr($query->getSql(), 0, 6) === 'SELECT') return $stmt->fetchAll(\PDO::FETCH_OBJ);
41
-        else return $stmt;
40
+		if (substr($query->getSql(), 0, 6) === 'SELECT') return $stmt->fetchAll(\PDO::FETCH_OBJ);
41
+		else return $stmt;
42 42
 	}
43 43
 	
44 44
 	public function lastInsertId() {
Please login to merge, or discard this patch.
maphper/lib/selectbuilder.php 1 patch
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -30,10 +30,10 @@  discard block
 block discarded – undo
30 30
 		$sql = [];
31 31
 
32 32
 		foreach ($fields as $key => $value) {
33
-            if ($value instanceof \DateTime) {
34
-    			if ($value->format('H:i:s')  == '00:00:00') $value = $value->format('Y-m-d');
35
-    			else $value = $value->format('Y-m-d H:i:s');
36
-    		}
33
+			if ($value instanceof \DateTime) {
34
+				if ($value->format('H:i:s')  == '00:00:00') $value = $value->format('Y-m-d');
35
+				else $value = $value->format('Y-m-d H:i:s');
36
+			}
37 37
 
38 38
 			if (is_numeric($key) && is_array($value)) {
39 39
 				$result = $this->createSql($value, $key);
@@ -85,17 +85,17 @@  discard block
 block discarded – undo
85 85
 		return ['args' => $args, 'sql' => [$query]];
86 86
 	}
87 87
 
88
-    private function getOperator($mode) {
89
-        $operator = "";
88
+	private function getOperator($mode) {
89
+		$operator = "";
90 90
 
91
-        if (\Maphper\Maphper::FIND_NOCASE & $mode) $operator = 'LIKE';
92
-        else if (\Maphper\Maphper::FIND_BIT & $mode) $operator = '&';
93
-        else if (\Maphper\Maphper::FIND_GREATER & $mode) $operator = '>';
94
-        else if (\Maphper\Maphper::FIND_LESS & $mode) $operator = '<';
95
-        else if (\Maphper\Maphper::FIND_NOT & $mode) $operator = '!=';
91
+		if (\Maphper\Maphper::FIND_NOCASE & $mode) $operator = 'LIKE';
92
+		else if (\Maphper\Maphper::FIND_BIT & $mode) $operator = '&';
93
+		else if (\Maphper\Maphper::FIND_GREATER & $mode) $operator = '>';
94
+		else if (\Maphper\Maphper::FIND_LESS & $mode) $operator = '<';
95
+		else if (\Maphper\Maphper::FIND_NOT & $mode) $operator = '!=';
96 96
 
97
-        if (\Maphper\Maphper::FIND_EXACT & $mode) $operator .= '=';
97
+		if (\Maphper\Maphper::FIND_EXACT & $mode) $operator .= '=';
98 98
 
99
-        return $operator;
100
-    }
99
+		return $operator;
100
+	}
101 101
 }
Please login to merge, or discard this patch.