Completed
Push — master ( 3097a5...bdf786 )
by Ron
03:10
created
src/Builder/Traits/TableBuilder.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
 	 * @return $this
14 14
 	 */
15 15
 	protected function addTable($alias, $table = null) {
16
-		if($table === null) {
16
+		if ($table === null) {
17 17
 			list($alias, $table) = [$table, $alias];
18 18
 		}
19 19
 		$this->tables[] = ['alias' => $alias, 'name' => $table];
@@ -26,10 +26,10 @@  discard block
 block discarded – undo
26 26
 	 */
27 27
 	protected function buildTables($query) {
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/Traits/GroupByBuilder.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -12,9 +12,9 @@  discard block
 block discarded – undo
12 12
 	 * @return $this
13 13
 	 */
14 14
 	public function groupBy(...$args) {
15
-		foreach($args as $expression) {
16
-			if(is_array($expression)) {
17
-				if(!count($expression)) {
15
+		foreach ($args as $expression) {
16
+			if (is_array($expression)) {
17
+				if (!count($expression)) {
18 18
 					continue;
19 19
 				}
20 20
 				$arguments = [
@@ -33,12 +33,12 @@  discard block
 block discarded – undo
33 33
 	 * @return string
34 34
 	 */
35 35
 	protected function buildGroups($query) {
36
-		if(!count($this->groupBy)) {
36
+		if (!count($this->groupBy)) {
37 37
 			return $query;
38 38
 		}
39 39
 		$query .= "GROUP BY\n";
40 40
 		$arr = [];
41
-		foreach($this->groupBy as $expression) {
41
+		foreach ($this->groupBy as $expression) {
42 42
 			$arr[] = "\t{$expression}";
43 43
 		}
44 44
 		return $query.implode(",\n", $arr)."\n";
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($query) {
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/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) {
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.