Completed
Push — master ( c83ea1...aef970 )
by Ron
03:49
created
Category
src/Builder/Traits/JoinBuilder.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -49,15 +49,15 @@
 block discarded – undo
49 49
 	 */
50 50
 	protected function buildJoins($query) {
51 51
 		$arr = array();
52
-		foreach($this->joinTables as $table) {
52
+		foreach ($this->joinTables as $table) {
53 53
 			$join = $table['type']." JOIN\n";
54
-			$join .= "\t" . $this->buildTableName($table['alias'], $table['name']);
55
-			if($table['expression']) {
56
-				$join .= " ON " . $this->db()->quoteExpression($table['expression'], $table['arguments']);
54
+			$join .= "\t".$this->buildTableName($table['alias'], $table['name']);
55
+			if ($table['expression']) {
56
+				$join .= " ON ".$this->db()->quoteExpression($table['expression'], $table['arguments']);
57 57
 			}
58 58
 			$arr[] = $join;
59 59
 		}
60
-		if(count($arr)) {
60
+		if (count($arr)) {
61 61
 			$query .= join("\n", $arr)."\n";
62 62
 		}
63 63
 		return $query;
Please login to merge, or discard this patch.
src/Builder/Delete.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 	 * @return $this
30 30
 	 */
31 31
 	public function from($alias, $table = null) {
32
-		if($table !== null) {
32
+		if ($table !== null) {
33 33
 			$this->aliases[] = $alias;
34 34
 		}
35 35
 		$this->addTable($alias, $table);
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 	public function __toString() {
44 44
 		$query = "DELETE ";
45 45
 		$query .= join(', ', $this->aliases);
46
-		$query = trim($query) . " FROM\n";
46
+		$query = trim($query)." FROM\n";
47 47
 		$query = $this->buildTables($query);
48 48
 		$query = $this->buildJoins($query);
49 49
 		$query = $this->buildWhereConditions($query);
Please login to merge, or discard this patch.
src/Builder/Helpers/FieldValueConverter.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -8,8 +8,8 @@
 block discarded – undo
8 8
 	 * @return array
9 9
 	 */
10 10
 	public static function convertValues(array $row, array $columnDefinitions) {
11
-		foreach($row as $key => &$value) {
12
-			if($value !== null) {
11
+		foreach ($row as $key => &$value) {
12
+			if ($value !== null) {
13 13
 				$value = self::convertValue($value, $columnDefinitions[$key]);
14 14
 			}
15 15
 		}
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
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
 	public static function getFieldTypes(QueryStatement $statement) {
12 12
 		$c = $statement->columnCount();
13 13
 		$fieldTypes = array();
14
-		for($i=0; $i<$c+20; $i++) {
14
+		for ($i = 0; $i < $c+20; $i++) {
15 15
 			$column = $statement->getColumnMeta($i);
16 16
 			$fieldTypes[$column['name']] = self::getTypeFromNativeType($column['native_type']);
17 17
 		}
Please login to merge, or discard this patch.
src/Builder/Helpers/LazyRowGenerator.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -21,14 +21,14 @@
 block discarded – undo
21 21
 	 * @return array[]|\Generator
22 22
 	 */
23 23
 	public function generate(QueryStatement $statement, Closure $callback = null) {
24
-		while($row = $statement->fetch(\PDO::FETCH_ASSOC)) {
25
-			if($this->preserveTypes) {
24
+		while ($row = $statement->fetch(\PDO::FETCH_ASSOC)) {
25
+			if ($this->preserveTypes) {
26 26
 				$columnDefinitions = FieldTypeProvider::getFieldTypes($statement);
27 27
 				$row = FieldValueConverter::convertValues($row, $columnDefinitions);
28 28
 			}
29
-			if($callback !== null) {
29
+			if ($callback !== null) {
30 30
 				$row = call_user_func($callback);
31
-				if($row !== null) {
31
+				if ($row !== null) {
32 32
 					yield $row;
33 33
 				}
34 34
 			} else {
Please login to merge, or discard this patch.
src/Builder/Internal/ConditionBuilder.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -12,12 +12,12 @@
 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 = array();
20
-		foreach($conditions as $condition) {
20
+		foreach ($conditions as $condition) {
21 21
 			list($expression, $arguments) = $condition;
22 22
 			$expr = $db->quoteExpression($expression, $arguments);
23 23
 			$arr[] = "\t({$expr})";
Please login to merge, or discard this patch.
src/Builder/Internal/DDLRunnable.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@
 block discarded – undo
25 25
 	public function run(array $params = array()) {
26 26
 		$this->query->execute($params);
27 27
 		$response = $this->query->getStatement()->rowCount();
28
-		if($this->callbackFn !== null) {
28
+		if ($this->callbackFn !== null) {
29 29
 			$response = call_user_func($this->callbackFn, $response);
30 30
 		}
31 31
 		return $response;
Please login to merge, or discard this patch.