Passed
Push — master ( 0570dc...14956b )
by Ron
02:29
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/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.
src/Builder/Statement.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -29,14 +29,14 @@
 block discarded – undo
29 29
 	 * @return $this
30 30
 	 */
31 31
 	public function debug($stop = true) {
32
-		if(array_key_exists('debug_formatter', $this->options)) {
32
+		if (array_key_exists('debug_formatter', $this->options)) {
33 33
 			$this->options['debug_formatter']();
34
-		} elseif(PHP_SAPI === 'cli') {
34
+		} elseif (PHP_SAPI === 'cli') {
35 35
 			echo "\n{$this->__toString()}\n";
36 36
 		} else {
37 37
 			echo "<pre>{$this->__toString()}</pre>";
38 38
 		}
39
-		if($stop) {
39
+		if ($stop) {
40 40
 			exit;
41 41
 		}
42 42
 		return $this;
Please login to merge, or discard this patch.
src/Databases/MySQL/MySQLSelect.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -125,7 +125,7 @@
 block discarded – undo
125 125
 	 * @return $this
126 126
 	 */
127 127
 	public function from(?string $alias, $table = null) {
128
-		if($table === null) {
128
+		if ($table === null) {
129 129
 			[$alias, $table] = [$table, $alias];
130 130
 			$this->addTable($alias, (string) $table);
131 131
 		} else {
Please login to merge, or discard this patch.