Completed
Push — master ( de8a99...be31cd )
by Ron
02:39
created
src/Builder/Traits/OrderByBuilder.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -13,11 +13,11 @@  discard block
 block discarded – undo
13 13
 	 * @return $this
14 14
 	 */
15 15
 	public function orderBy($expression, $direction = 'asc') {
16
-		if(strtolower($direction) != 'desc') {
16
+		if (strtolower($direction) != 'desc') {
17 17
 			$direction = 'ASC';
18 18
 		}
19
-		if(is_array($expression)) {
20
-			if(!count($expression)) {
19
+		if (is_array($expression)) {
20
+			if (!count($expression)) {
21 21
 				return $this;
22 22
 			}
23 23
 			$arguments = array(
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 	 */
35 35
 	public function orderByValues($fieldName, array $values) {
36 36
 		$expr = [];
37
-		foreach(array_values($values) as $idx => $value) {
37
+		foreach (array_values($values) as $idx => $value) {
38 38
 			$expr[] = $this->db()->quoteExpression("WHEN ? THEN ?", array($value, $idx));
39 39
 		}
40 40
 		$this->orderBy[] = array(sprintf("CASE %s\n\t\t%s\n\tEND", $this->db()->quoteField($fieldName), join("\n\t\t", $expr)), 'ASC');
@@ -46,12 +46,12 @@  discard block
 block discarded – undo
46 46
 	 * @return string
47 47
 	 */
48 48
 	protected function buildOrder($query) {
49
-		if(!count($this->orderBy)) {
49
+		if (!count($this->orderBy)) {
50 50
 			return $query;
51 51
 		}
52 52
 		$query .= "ORDER BY\n";
53 53
 		$arr = array();
54
-		foreach($this->orderBy as $order) {
54
+		foreach ($this->orderBy as $order) {
55 55
 			list($expression, $direction) = $order;
56 56
 			$arr[] = sprintf("\t%s %s", $expression, strtoupper($direction));
57 57
 		}
Please login to merge, or discard this patch.
src/Databases/MySQL/MySQLExceptionInterpreter.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -16,14 +16,14 @@
 block discarded – undo
16 16
 	public function throwMoreConcreteException(PDOException $exception) {
17 17
 		$code = $exception->errorInfo[1];
18 18
 		$message = (string) $exception->errorInfo[2];
19
-		switch($code) {
19
+		switch ($code) {
20 20
 			case 2006: throw new DatabaseHasGoneAwayException($message, $code, $exception);
21 21
 			case 1213: throw new SqlDeadLockException($message, $code, $exception);
22 22
 			case 1205: throw new LockWaitTimeoutExceededException($message, $code, $exception);
23 23
 			case 1062: throw new DuplicateUniqueKeyException($message, $code, $exception);
24 24
 		}
25 25
 		/** @link http://php.net/manual/en/class.exception.php#Hcom115813 (cHao's comment) */
26
-		if(!is_string($message) || !is_int($code)) {
26
+		if (!is_string($message) || !is_int($code)) {
27 27
 			throw new SqlException((string) $message, (int) $code, $exception);
28 28
 		}
29 29
 		throw $exception;
Please login to merge, or discard this patch.
src/Builder/RunnableSelect.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -169,7 +169,7 @@
 block discarded – undo
169 169
 	}
170 170
 
171 171
 	/**
172
-	 * @return bool
172
+	 * @return integer
173 173
 	 */
174 174
 	public function getFoundRows() {
175 175
 		return $this->foundRows;
Please login to merge, or discard this patch.
Spacing   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -63,20 +63,20 @@  discard block
 block discarded – undo
63 63
 	 * @return array[]
64 64
 	 */
65 65
 	public function fetchRows(Closure $callback = null) {
66
-		return $this->createTempStatement(function (QueryStatement $statement) use ($callback) {
66
+		return $this->createTempStatement(function(QueryStatement $statement) use ($callback) {
67 67
 			$statement->setFetchMode(PDO::FETCH_ASSOC);
68 68
 			$data = $statement->fetchAll();
69
-			if($this->preserveTypes) {
69
+			if ($this->preserveTypes) {
70 70
 				$columnDefinitions = FieldTypeProvider::getFieldTypes($statement);
71
-				foreach($data as &$row) {
71
+				foreach ($data as &$row) {
72 72
 					$row = FieldValueConverter::convertValues($row, $columnDefinitions);
73 73
 				}
74 74
 			}
75
-			if($callback !== null) {
76
-				return call_user_func(function ($resultData = []) use ($data, $callback) {
77
-					foreach($data as $row) {
75
+			if ($callback !== null) {
76
+				return call_user_func(function($resultData = []) use ($data, $callback) {
77
+					foreach ($data as $row) {
78 78
 						$result = $callback($row);
79
-						if($result !== null && !($result instanceof DBIgnoreRow)) {
79
+						if ($result !== null && !($result instanceof DBIgnoreRow)) {
80 80
 							$resultData[] = $result;
81 81
 						} else {
82 82
 							$resultData[] = $row;
@@ -94,8 +94,8 @@  discard block
 block discarded – undo
94 94
 	 * @return array[]|\Generator
95 95
 	 */
96 96
 	public function fetchRowsLazy(Closure $callback = null) {
97
-		if(version_compare(PHP_VERSION, '5.5', '<')) {
98
-			return new YieldPolyfillIterator($callback, $this->preserveTypes, function () {
97
+		if (version_compare(PHP_VERSION, '5.5', '<')) {
98
+			return new YieldPolyfillIterator($callback, $this->preserveTypes, function() {
99 99
 				$statement = $this->createStatement();
100 100
 				$statement->setFetchMode(PDO::FETCH_ASSOC);
101 101
 				return $statement;
@@ -113,19 +113,19 @@  discard block
 block discarded – undo
113 113
 	 * @throws \Exception
114 114
 	 */
115 115
 	public function fetchRow(Closure $callback = null) {
116
-		return $this->createTempStatement(function (QueryStatement $statement) use ($callback) {
116
+		return $this->createTempStatement(function(QueryStatement $statement) use ($callback) {
117 117
 			$statement->setFetchMode(PDO::FETCH_ASSOC);
118 118
 			$row = $statement->fetch();
119
-			if(!is_array($row)) {
119
+			if (!is_array($row)) {
120 120
 				return [];
121 121
 			}
122
-			if($this->preserveTypes) {
122
+			if ($this->preserveTypes) {
123 123
 				$columnDefinitions = FieldTypeProvider::getFieldTypes($statement);
124 124
 				$row = FieldValueConverter::convertValues($row, $columnDefinitions);
125 125
 			}
126
-			if($callback !== null) {
126
+			if ($callback !== null) {
127 127
 				$result = $callback($row);
128
-				if($result !== null) {
128
+				if ($result !== null) {
129 129
 					$row = $result;
130 130
 				}
131 131
 			}
@@ -140,20 +140,20 @@  discard block
 block discarded – undo
140 140
 	 * @throws \Exception
141 141
 	 */
142 142
 	public function fetchObjects($className, Closure $callback = null) {
143
-		return $this->createTempStatement(function (QueryStatement $statement) use ($className, $callback) {
143
+		return $this->createTempStatement(function(QueryStatement $statement) use ($className, $callback) {
144 144
 			$statement->setFetchMode(PDO::FETCH_CLASS, $className);
145 145
 			$data = $statement->fetchAll();
146
-			if($this->preserveTypes) {
146
+			if ($this->preserveTypes) {
147 147
 				$columnDefinitions = FieldTypeProvider::getFieldTypes($statement);
148
-				foreach($data as &$row) {
148
+				foreach ($data as &$row) {
149 149
 					$row = FieldValueConverter::convertValues($row, $columnDefinitions);
150 150
 				}
151 151
 			}
152
-			if($callback !== null) {
153
-				return call_user_func(function ($resultData = []) use ($data, $callback) {
154
-					foreach($data as $row) {
152
+			if ($callback !== null) {
153
+				return call_user_func(function($resultData = []) use ($data, $callback) {
154
+					foreach ($data as $row) {
155 155
 						$result = $callback($row);
156
-						if($result !== null && !($result instanceof DBIgnoreRow)) {
156
+						if ($result !== null && !($result instanceof DBIgnoreRow)) {
157 157
 							$resultData[] = $result;
158 158
 						} else {
159 159
 							$resultData[] = $row;
@@ -172,8 +172,8 @@  discard block
 block discarded – undo
172 172
 	 * @return array[]|Generator
173 173
 	 */
174 174
 	public function fetchObjectsLazy($className, Closure $callback = null) {
175
-		if(version_compare(PHP_VERSION, '5.5', '<')) {
176
-			return new YieldPolyfillIterator($callback, $this->preserveTypes, function () use ($className) {
175
+		if (version_compare(PHP_VERSION, '5.5', '<')) {
176
+			return new YieldPolyfillIterator($callback, $this->preserveTypes, function() use ($className) {
177 177
 				$statement = $this->createStatement();
178 178
 				$statement->setFetchMode(PDO::FETCH_CLASS, $className);
179 179
 				return $statement;
@@ -192,19 +192,19 @@  discard block
 block discarded – undo
192 192
 	 * @throws \Exception
193 193
 	 */
194 194
 	public function fetchObject($className, Closure $callback = null) {
195
-		return $this->createTempStatement(function (QueryStatement $statement) use ($className, $callback) {
195
+		return $this->createTempStatement(function(QueryStatement $statement) use ($className, $callback) {
196 196
 			$statement->setFetchMode(PDO::FETCH_CLASS, $className);
197 197
 			$row = $statement->fetch();
198
-			if(!is_array($row)) {
198
+			if (!is_array($row)) {
199 199
 				return [];
200 200
 			}
201
-			if($this->preserveTypes) {
201
+			if ($this->preserveTypes) {
202 202
 				$columnDefinitions = FieldTypeProvider::getFieldTypes($statement);
203 203
 				$row = FieldValueConverter::convertValues($row, $columnDefinitions);
204 204
 			}
205
-			if($callback !== null) {
205
+			if ($callback !== null) {
206 206
 				$result = $callback($row);
207
-				if($result !== null) {
207
+				if ($result !== null) {
208 208
 					$row = $result;
209 209
 				}
210 210
 			}
@@ -217,11 +217,11 @@  discard block
 block discarded – undo
217 217
 	 * @return mixed[]
218 218
 	 */
219 219
 	public function fetchKeyValue($treatValueAsArray = false) {
220
-		return $this->createTempStatement(function (QueryStatement $statement) use ($treatValueAsArray) {
221
-			if($treatValueAsArray) {
220
+		return $this->createTempStatement(function(QueryStatement $statement) use ($treatValueAsArray) {
221
+			if ($treatValueAsArray) {
222 222
 				$rows = $statement->fetchAll(\PDO::FETCH_ASSOC);
223 223
 				$result = array();
224
-				foreach($rows as $row) {
224
+				foreach ($rows as $row) {
225 225
 					list($key) = array_values($row);
226 226
 					$result[$key] = $row;
227 227
 				}
@@ -238,11 +238,11 @@  discard block
 block discarded – undo
238 238
 	public function fetchGroups(array $fields) {
239 239
 		$rows = $this->fetchRows();
240 240
 		$result = array();
241
-		foreach($rows as $row) {
241
+		foreach ($rows as $row) {
242 242
 			$tmp = &$result;
243
-			foreach($fields as $field) {
243
+			foreach ($fields as $field) {
244 244
 				$value = $row[$field];
245
-				if(!array_key_exists($value, $tmp)) {
245
+				if (!array_key_exists($value, $tmp)) {
246 246
 					$tmp[$value] = [];
247 247
 				}
248 248
 				$tmp = &$tmp[$value];
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
 	 * @return string[]
257 257
 	 */
258 258
 	public function fetchArray() {
259
-		return $this->createTempStatement(function (QueryStatement $stmt) {
259
+		return $this->createTempStatement(function(QueryStatement $stmt) {
260 260
 			return $stmt->fetchAll(\PDO::FETCH_COLUMN);
261 261
 		});
262 262
 	}
@@ -266,9 +266,9 @@  discard block
 block discarded – undo
266 266
 	 * @return null|bool|string|int|float
267 267
 	 */
268 268
 	public function fetchValue($default = null) {
269
-		return $this->createTempStatement(function (QueryStatement $stmt) use ($default) {
269
+		return $this->createTempStatement(function(QueryStatement $stmt) use ($default) {
270 270
 			$result = $stmt->fetch(\PDO::FETCH_NUM);
271
-			if($result !== false) {
271
+			if ($result !== false) {
272 272
 				return $result[0];
273 273
 			}
274 274
 			return $default;
@@ -308,7 +308,7 @@  discard block
 block discarded – undo
308 308
 		$query = $this->__toString();
309 309
 		$statement = $db->prepare($query);
310 310
 		$statement->execute($this->values);
311
-		if($this->getCalcFoundRows()) {
311
+		if ($this->getCalcFoundRows()) {
312 312
 			$this->foundRows = (int) $db->query('SELECT FOUND_ROWS()')->fetchColumn();
313 313
 		}
314 314
 		return $statement;
Please login to merge, or discard this patch.
src/Builder/Internal/ConditionBuilder.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -12,15 +12,15 @@
 block discarded – undo
12 12
 	 * @return string
13 13
 	 */
14 14
 	public static function build(Database $db, $query, array $conditions, $token) {
15
-		if(!count($conditions)) {
15
+		if (!count($conditions)) {
16 16
 			return $query;
17 17
 		}
18 18
 		$query .= "{$token}\n";
19 19
 		$arr = [];
20
-		foreach($conditions as $condition) {
20
+		foreach ($conditions as $condition) {
21 21
 			list($expression, $arguments) = $condition;
22
-			if(is_array($expression)) {
23
-				foreach($expression as $key => $value) {
22
+			if (is_array($expression)) {
23
+				foreach ($expression as $key => $value) {
24 24
 					$arr = self::buildCondition($arr, "`{$key}`=?", [$value], $db);
25 25
 				}
26 26
 			} else {
Please login to merge, or discard this patch.
src/Databases/MySQL.php 1 patch
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 	 * @param PDO $pdo
36 36
 	 */
37 37
 	public function __construct(PDO $pdo) {
38
-		if($pdo->getAttribute(PDO::ATTR_ERRMODE) === PDO::ERRMODE_SILENT) {
38
+		if ($pdo->getAttribute(PDO::ATTR_ERRMODE) === PDO::ERRMODE_SILENT) {
39 39
 			$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
40 40
 		}
41 41
 		$this->pdo = $pdo;
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 	 * @return QueryStatement
65 65
 	 */
66 66
 	public function query($query) {
67
-		return $this->buildQueryStatement($query, function ($query) {
67
+		return $this->buildQueryStatement($query, function($query) {
68 68
 			$stmt = $this->pdo->query($query);
69 69
 			return $stmt;
70 70
 		});
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
 	 * @return QueryStatement
77 77
 	 */
78 78
 	public function prepare($query) {
79
-		return $this->buildQueryStatement((string) $query, function ($query) {
79
+		return $this->buildQueryStatement((string) $query, function($query) {
80 80
 			$stmt = $this->pdo->prepare($query);
81 81
 			return $stmt;
82 82
 		});
@@ -88,11 +88,11 @@  discard block
 block discarded – undo
88 88
 	 * @return int
89 89
 	 */
90 90
 	public function exec($query, array $params = array()) {
91
-		return $this->exceptionHandler(function () use ($query, $params) {
91
+		return $this->exceptionHandler(function() use ($query, $params) {
92 92
 			$stmt = $this->pdo->prepare($query);
93 93
 			$timer = microtime(true);
94 94
 			$stmt->execute($params);
95
-			$this->queryLoggers->log($query, microtime(true) - $timer);
95
+			$this->queryLoggers->log($query, microtime(true)-$timer);
96 96
 			$result = $stmt->rowCount();
97 97
 			$stmt->closeCursor();
98 98
 			return $result;
@@ -112,12 +112,12 @@  discard block
 block discarded – undo
112 112
 	 */
113 113
 	public function getTableFields($table) {
114 114
 		$table = $this->select()->aliasReplacer()->replace($table);
115
-		if(array_key_exists($table, self::$tableFields)) {
115
+		if (array_key_exists($table, self::$tableFields)) {
116 116
 			return self::$tableFields[$table];
117 117
 		}
118 118
 		$stmt = $this->pdo->query("DESCRIBE {$table}");
119 119
 		$rows = $stmt->fetchAll(\PDO::FETCH_ASSOC);
120
-		self::$tableFields[$table] = array_map(function ($row) { return $row['Field']; }, $rows);
120
+		self::$tableFields[$table] = array_map(function($row) { return $row['Field']; }, $rows);
121 121
 		$stmt->closeCursor();
122 122
 		return self::$tableFields[$table];
123 123
 	}
@@ -128,11 +128,11 @@  discard block
 block discarded – undo
128 128
 	 * @return string
129 129
 	 */
130 130
 	public function quoteExpression($expression, array $arguments = array()) {
131
-		$func = function () use ($arguments) {
131
+		$func = function() use ($arguments) {
132 132
 			static $idx = -1;
133 133
 			$idx++;
134 134
 			$index = $idx;
135
-			if(array_key_exists($index, $arguments)) {
135
+			if (array_key_exists($index, $arguments)) {
136 136
 				$argument = $arguments[$index];
137 137
 				$value = $this->quote($argument);
138 138
 			} else {
@@ -149,14 +149,14 @@  discard block
 block discarded – undo
149 149
 	 * @return string
150 150
 	 */
151 151
 	public function quote($value) {
152
-		if(is_null($value)) {
152
+		if (is_null($value)) {
153 153
 			$result = 'NULL';
154
-		} elseif($value instanceof Builder\DBExpr) {
154
+		} elseif ($value instanceof Builder\DBExpr) {
155 155
 			$result = $value->getExpression();
156
-		} elseif($value instanceof Builder\Select) {
156
+		} elseif ($value instanceof Builder\Select) {
157 157
 			$result = sprintf('(%s)', (string) $value);
158
-		} elseif(is_array($value)) {
159
-			$result = join(', ', array_map(function ($value) { return $this->quote($value); }, $value));
158
+		} elseif (is_array($value)) {
159
+			$result = join(', ', array_map(function($value) { return $this->quote($value); }, $value));
160 160
 		} else {
161 161
 			$result = $this->pdo->quote($value);
162 162
 		}
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
 		if (is_numeric($field) || !is_string($field)) {
172 172
 			throw new UnexpectedValueException('Field name is invalid');
173 173
 		}
174
-		if(strpos($field, '`') !== false) {
174
+		if (strpos($field, '`') !== false) {
175 175
 			return (string) $field;
176 176
 		}
177 177
 		$parts = explode('.', $field);
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
 	 */
185 185
 	public function select(array $fields = null) {
186 186
 		$select = new RunnableSelect($this);
187
-		if($fields !== null) {
187
+		if ($fields !== null) {
188 188
 			$select->fields($fields);
189 189
 		}
190 190
 		return $select;
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
 	 */
197 197
 	public function insert(array $fields = null) {
198 198
 		$insert = new Builder\RunnableInsert($this);
199
-		if($fields !== null) {
199
+		if ($fields !== null) {
200 200
 			$insert->addAll($fields);
201 201
 		}
202 202
 		return $insert;
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
 	 */
209 209
 	public function update(array $fields = null) {
210 210
 		$update = new Builder\RunnableUpdate($this);
211
-		if($fields !== null) {
211
+		if ($fields !== null) {
212 212
 			$update->setAll($fields);
213 213
 		}
214 214
 		return $update;
@@ -225,8 +225,8 @@  discard block
 block discarded – undo
225 225
 	 * @return $this
226 226
 	 */
227 227
 	public function transactionStart() {
228
-		if((int) $this->transactionLevel === 0) {
229
-			if($this->pdo->inTransaction()) {
228
+		if ((int) $this->transactionLevel === 0) {
229
+			if ($this->pdo->inTransaction()) {
230 230
 				$this->outerTransaction = true;
231 231
 			} else {
232 232
 				$this->pdo->beginTransaction();
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
 	 * @throws \Exception
242 242
 	 */
243 243
 	public function transactionCommit() {
244
-		return $this->transactionEnd(function () {
244
+		return $this->transactionEnd(function() {
245 245
 			$this->pdo->commit();
246 246
 		});
247 247
 	}
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
 	 * @throws \Exception
252 252
 	 */
253 253
 	public function transactionRollback() {
254
-		return $this->transactionEnd(function () {
254
+		return $this->transactionEnd(function() {
255 255
 			$this->pdo->rollBack();
256 256
 		});
257 257
 	}
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
 	public function dryRun($callback = null) {
266 266
 		$result = null;
267 267
 		$exception = null;
268
-		if(!$this->pdo->inTransaction()) {
268
+		if (!$this->pdo->inTransaction()) {
269 269
 			$this->transactionStart();
270 270
 			try {
271 271
 				$result = call_user_func($callback, $this);
@@ -273,7 +273,7 @@  discard block
 block discarded – undo
273 273
 				$exception = $e;
274 274
 			}
275 275
 			$this->transactionRollback();
276
-			if($exception !== null) {
276
+			if ($exception !== null) {
277 277
 				throw $exception;
278 278
 			}
279 279
 		} else {
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
 				$exception = $e;
286 286
 			}
287 287
 			$this->exec("ROLLBACK TO {$uniqueId}");
288
-			if($exception !== null) {
288
+			if ($exception !== null) {
289 289
 				throw $exception;
290 290
 			}
291 291
 		}
@@ -300,15 +300,15 @@  discard block
 block discarded – undo
300 300
 	 * @throws null
301 301
 	 */
302 302
 	public function transaction($tries = 1, $callback = null) {
303
-		if(is_callable($tries)) {
303
+		if (is_callable($tries)) {
304 304
 			$callback = $tries;
305 305
 			$tries = 1;
306
-		} elseif(!is_callable($callback)) {
306
+		} elseif (!is_callable($callback)) {
307 307
 			throw new \Exception('$callback must be a callable');
308 308
 		}
309 309
 		$e = null;
310
-		if(!$this->pdo->inTransaction()) {
311
-			for(; $tries--;) {
310
+		if (!$this->pdo->inTransaction()) {
311
+			for (; $tries--;) {
312 312
 				try {
313 313
 					$this->transactionStart();
314 314
 					$result = call_user_func($callback, $this);
@@ -339,11 +339,11 @@  discard block
 block discarded – undo
339 339
 	 */
340 340
 	private function transactionEnd($fn) {
341 341
 		$this->transactionLevel--;
342
-		if($this->transactionLevel < 0) {
342
+		if ($this->transactionLevel < 0) {
343 343
 			throw new \Exception("Transaction-Nesting-Problem: Trying to invoke commit on a already closed transaction");
344 344
 		}
345
-		if((int) $this->transactionLevel === 0) {
346
-			if($this->outerTransaction) {
345
+		if ((int) $this->transactionLevel === 0) {
346
+			if ($this->outerTransaction) {
347 347
 				$this->outerTransaction = false;
348 348
 			} else {
349 349
 				call_user_func($fn);
@@ -360,7 +360,7 @@  discard block
 block discarded – undo
360 360
 	 */
361 361
 	private function buildQueryStatement($query, $fn) {
362 362
 		$stmt = call_user_func($fn, $query);
363
-		if(!$stmt) {
363
+		if (!$stmt) {
364 364
 			throw new Exception("Could not execute statement:\n{$query}");
365 365
 		}
366 366
 		$stmtWrapper = new QueryStatement($stmt, $query, $this->exceptionInterpreter, $this->queryLoggers);
Please login to merge, or discard this patch.
src/Builder/Helpers/FieldTypeProvider.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@
 block discarded – undo
10 10
 	 */
11 11
 	public static function getFieldTypes(QueryStatement $statement) {
12 12
 		$fieldTypes = array();
13
-		for($i = 0; $column = $statement->getColumnMeta($i); $i++) {
13
+		for ($i = 0; $column = $statement->getColumnMeta($i); $i++) {
14 14
 			$fieldTypes[$column['name']] = self::getTypeFromNativeType($column['native_type']);
15 15
 		}
16 16
 		return $fieldTypes;
Please login to merge, or discard this patch.
src/Builder/Traits/HavingBuilder.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -16,8 +16,8 @@
 block discarded – undo
16 16
 	 * @return $this
17 17
 	 */
18 18
 	public function having($expression) {
19
-		if($expression instanceof OptionalExpression) {
20
-			if($expression->isValid()) {
19
+		if ($expression instanceof OptionalExpression) {
20
+			if ($expression->isValid()) {
21 21
 				$this->having[] = [$expression->getExpression(), $expression->getData()];
22 22
 			}
23 23
 		} else {
Please login to merge, or discard this patch.
src/Builder/Traits/WhereBuilder.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -16,8 +16,8 @@
 block discarded – undo
16 16
 	 * @return $this
17 17
 	 */
18 18
 	public function having($expression) {
19
-		if($expression instanceof OptionalExpression) {
20
-			if($expression->isValid()) {
19
+		if ($expression instanceof OptionalExpression) {
20
+			if ($expression->isValid()) {
21 21
 				$this->having[] = [$expression->getExpression(), $expression->getData()];
22 22
 			}
23 23
 		} else {
Please login to merge, or discard this patch.
src/Builder/Expr/RequiredDBFilterMap.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -27,8 +27,8 @@
 block discarded – undo
27 27
 	 * @return DBExprFilter
28 28
 	 */
29 29
 	public function __invoke($expression, $keyPath, $validator = null) {
30
-		return new DBExprFilter($expression, $this->map, $keyPath, $validator, function ($result, array $data) {
31
-			if(!$result) {
30
+		return new DBExprFilter($expression, $this->map, $keyPath, $validator, function($result, array $data) {
31
+			if (!$result) {
32 32
 				throw new RequiredValueNotFoundException(sprintf("Required value %s not found", $data['key']));
33 33
 			}
34 34
 		});
Please login to merge, or discard this patch.