Passed
Push — master ( 8ae334...8eeffd )
by Ron
02:38
created
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 = []) {
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.
src/Tools/VirtualTables.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -31,10 +31,10 @@
 block discarded – undo
31 31
 	 * @return Select|null
32 32
 	 */
33 33
 	public function get($tableName): ?Select {
34
-		if($this->has($tableName)) {
34
+		if ($this->has($tableName)) {
35 35
 			$table = $this->virtualTables[(string) $tableName];
36
-			if($table instanceof Closure) {
37
-				if($tableName instanceof VirtualTable) {
36
+			if ($table instanceof Closure) {
37
+				if ($tableName instanceof VirtualTable) {
38 38
 					$params = $tableName->getParams();
39 39
 					return $table($params);
40 40
 				}
Please login to merge, or discard this patch.
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(string $query): string {
51 51
 		$arr = [];
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 .= implode("\n", $arr)."\n";
62 62
 		}
63 63
 		return $query;
Please login to merge, or discard this patch.
src/Builder/Traits/UnionBuilder.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 	 * @return $this
15 15
 	 */
16 16
 	public function union(...$queries) {
17
-		foreach($queries as $query) {
17
+		foreach ($queries as $query) {
18 18
 			$this->unions[] = ['', $query];
19 19
 		}
20 20
 		return $this;
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 	 * @return $this
26 26
 	 */
27 27
 	public function unionAll(...$queries) {
28
-		foreach($queries as $query) {
28
+		foreach ($queries as $query) {
29 29
 			$this->unions[] = ['ALL', $query];
30 30
 		}
31 31
 		return $this;
@@ -36,21 +36,21 @@  discard block
 block discarded – undo
36 36
 	 * @return string
37 37
 	 */
38 38
 	protected function buildUnions(string $query): string {
39
-		$wrap = static function ($query) {
39
+		$wrap = static function($query) {
40 40
 			$query = trim($query);
41 41
 			$query = implode("\n\t", explode("\n", $query));
42 42
 			return sprintf("(\n\t%s\n)", $query);
43 43
 		};
44 44
 		$queries = [$wrap($query)];
45
-		foreach($this->unions as $unionQuery) {
46
-			if($unionQuery[0] === 'ALL') {
45
+		foreach ($this->unions as $unionQuery) {
46
+			if ($unionQuery[0] === 'ALL') {
47 47
 				$queries[] = 'UNION ALL';
48 48
 			} else {
49 49
 				$queries[] = 'UNION';
50 50
 			}
51 51
 			$queries[] = $wrap($unionQuery[1]);
52 52
 		}
53
-		if(count($queries) > 1) {
53
+		if (count($queries) > 1) {
54 54
 			return implode(' ', $queries);
55 55
 		}
56 56
 		return $query;
Please login to merge, or discard this patch.
src/Builder/Traits/GroupByBuilder.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -14,9 +14,9 @@  discard block
 block discarded – undo
14 14
 	 * @return $this
15 15
 	 */
16 16
 	public function groupBy(...$args) {
17
-		foreach($args as $expression) {
18
-			if(is_array($expression)) {
19
-				if(!count($expression)) {
17
+		foreach ($args as $expression) {
18
+			if (is_array($expression)) {
19
+				if (!count($expression)) {
20 20
 					continue;
21 21
 				}
22 22
 				$expression = $this->quoteExpr($expression[0], array_slice($expression, 1));
@@ -31,12 +31,12 @@  discard block
 block discarded – undo
31 31
 	 * @return string
32 32
 	 */
33 33
 	protected function buildGroups(string $query): string {
34
-		if(!count($this->groupBy)) {
34
+		if (!count($this->groupBy)) {
35 35
 			return $query;
36 36
 		}
37 37
 		$query .= "GROUP BY\n";
38 38
 		$arr = [];
39
-		foreach($this->groupBy as $expression) {
39
+		foreach ($this->groupBy as $expression) {
40 40
 			$arr[] = "\t{$expression}";
41 41
 		}
42 42
 		return $query.implode(",\n", $arr)."\n";
Please login to merge, or discard this patch.
src/Builder/Traits/TableBuilder.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,10 +26,10 @@
 block discarded – undo
26 26
 	 */
27 27
 	protected function buildTables(string $query): string {
28 28
 		$arr = [];
29
-		foreach($this->tables as $table) {
29
+		foreach ($this->tables as $table) {
30 30
 			$arr[] = "\t".$this->buildTableName($table['alias'], $table['name']);
31 31
 		}
32
-		if(count($arr)) {
32
+		if (count($arr)) {
33 33
 			$query .= implode(",\n", $arr)."\n";
34 34
 		}
35 35
 		return $query;
Please login to merge, or discard this patch.
src/Builder/InsertUpdateStatement.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -31,13 +31,13 @@
 block discarded – undo
31 31
 	 */
32 32
 	protected function buildFieldList(array $fields, array $query = []): array {
33 33
 		foreach ($fields as $fieldName => $fieldValue) {
34
-			if($fieldValue instanceof DefaultValue) {
34
+			if ($fieldValue instanceof DefaultValue) {
35 35
 				$fieldValue = 'DEFAULT';
36 36
 			}
37
-			if(is_array($this->mask) && !in_array($fieldName, $this->mask, true)) {
37
+			if (is_array($this->mask) && !in_array($fieldName, $this->mask, true)) {
38 38
 				continue;
39 39
 			}
40
-			if(is_int($fieldName)) {
40
+			if (is_int($fieldName)) {
41 41
 				if (is_array($fieldValue)) {
42 42
 					$fieldValue = $this->db()->quoteExpression($fieldValue[0], array_slice($fieldValue, 1));
43 43
 				}
Please login to merge, or discard this patch.
src/Builder/Helpers/ConditionAddHelper.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -10,13 +10,13 @@  discard block
 block discarded – undo
10 10
 	 * @param array<int, mixed> $args
11 11
 	 */
12 12
 	public static function addCondition(callable $addFn, $expression, array $args): void {
13
-		if($expression instanceof OptionalExpression) {
14
-			if($expression->isValid()) {
13
+		if ($expression instanceof OptionalExpression) {
14
+			if ($expression->isValid()) {
15 15
 				$addFn($expression->getExpression(), [$expression->getValue()]);
16 16
 			}
17
-		} elseif(is_object($expression)) {
17
+		} elseif (is_object($expression)) {
18 18
 			self::addAsArray($addFn, (array) $expression, $args);
19
-		} elseif(is_array($expression)) {
19
+		} elseif (is_array($expression)) {
20 20
 			self::addAsArray($addFn, $expression, $args);
21 21
 		} else {
22 22
 			$addFn($expression, $args);
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 	 * @param array<int, mixed> $args
30 30
 	 */
31 31
 	private static function addAsArray(callable $addFn, array $expression, array $args): void {
32
-		if(count($expression) > 0) {
32
+		if (count($expression) > 0) {
33 33
 			$addFn($expression, $args);
34 34
 		}
35 35
 	}
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
@@ -9,8 +9,8 @@
 block discarded – undo
9 9
 	 */
10 10
 	public static function convertValues(array $row, array $columnDefinitions): array {
11 11
 		$result = [];
12
-		foreach($row as $key => $value) {
13
-			if($value !== null) {
12
+		foreach ($row as $key => $value) {
13
+			if ($value !== null) {
14 14
 				$result[$key] = self::convertValue($value, $columnDefinitions[$key]);
15 15
 			} else {
16 16
 				$result[$key] = $value;
Please login to merge, or discard this patch.