Completed
Push — master ( 533386...57d77d )
by smiley
02:37
created
src/Query/Dialects/Postgres/Select.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -36,8 +36,8 @@
 block discarded – undo
36 36
 
37 37
 		$sql  = 'SELECT ';
38 38
 		$sql .= $this->distinct ? 'DISTINCT ' : '';
39
-		$sql .= !empty($this->cols) ? implode($glue , $this->cols).PHP_EOL : '* ';
40
-		$sql .= 'FROM '.implode($glue , $this->from);
39
+		$sql .= !empty($this->cols) ? implode($glue, $this->cols).PHP_EOL : '* ';
40
+		$sql .= 'FROM '.implode($glue, $this->from);
41 41
 		$sql .= $this->_getWhere();
42 42
 		$sql .= !empty($this->groupby) ? PHP_EOL.'GROUP BY '.implode($glue, $this->groupby) : '';
43 43
 		$sql .= !empty($this->orderby) ? PHP_EOL.'ORDER BY '.implode($glue, $this->orderby) : '';
Please login to merge, or discard this patch.
src/Query/Dialects/SQLite/Select.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -36,8 +36,8 @@
 block discarded – undo
36 36
 
37 37
 		$sql  = 'SELECT ';
38 38
 		$sql .= $this->distinct ? 'DISTINCT ' : '';
39
-		$sql .= !empty($this->cols) ? implode($glue , $this->cols).PHP_EOL : '* ';
40
-		$sql .= 'FROM '.implode($glue , $this->from);
39
+		$sql .= !empty($this->cols) ? implode($glue, $this->cols).PHP_EOL : '* ';
40
+		$sql .= 'FROM '.implode($glue, $this->from);
41 41
 		$sql .= $this->_getWhere();
42 42
 		$sql .= !empty($this->groupby) ? PHP_EOL.'GROUP BY '.implode($glue, $this->groupby) : '';
43 43
 		$sql .= !empty($this->orderby) ? PHP_EOL.'ORDER BY '.implode($glue, $this->orderby) : '';
Please login to merge, or discard this patch.
src/Query/SelectAbstract.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 			if(is_string($k)){
84 84
 				is_array($ref)
85 85
 					? $this->addColumn($ref[0], $k, $ref[1] ?? null)
86
-					: $this->addColumn($ref ,$k);
86
+					: $this->addColumn($ref, $k);
87 87
 			}
88 88
 			else{
89 89
 				is_array($ref)
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
 		$from = $this->quote($table);
106 106
 
107 107
 		if($ref){
108
-			$from = sprintf('%s AS %s', $this->quote($ref), $this->quote($table));// @todo: index hint
108
+			$from = sprintf('%s AS %s', $this->quote($ref), $this->quote($table)); // @todo: index hint
109 109
 		}
110 110
 
111 111
 		$this->from[$ref ?? $table] = $from;
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
 					$dir = strtoupper($expression[0]);
177 177
 
178 178
 					if(in_array($dir, ['ASC', 'DESC'])){
179
-						$this->orderby[] =  isset($expression[1]) ? strtoupper($expression[1]).'('.$this->quote($alias).') '.$dir : $dir;
179
+						$this->orderby[] = isset($expression[1]) ? strtoupper($expression[1]).'('.$this->quote($alias).') '.$dir : $dir;
180 180
 					}
181 181
 
182 182
 				}
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
 					$dir = strtoupper($expression);
185 185
 
186 186
 					if(in_array($dir, ['ASC', 'DESC'])){
187
-						$this->orderby[] =  $this->quote($alias).' '.$dir;
187
+						$this->orderby[] = $this->quote($alias).' '.$dir;
188 188
 					}
189 189
 
190 190
 				}
Please login to merge, or discard this patch.
tests/Query/QueryTestAbstract.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -113,9 +113,9 @@  discard block
 block discarded – undo
113 113
 		$insert
114 114
 			->into(self::TEST_TABLENAME)
115 115
 			->values([
116
-				['id' => 1, 'hash' => md5(1), 'data' => 'foo', 'value' => 123.456,    'active' => 0],
116
+				['id' => 1, 'hash' => md5(1), 'data' => 'foo', 'value' => 123.456, 'active' => 0],
117 117
 				['id' => 2, 'hash' => md5(2), 'data' => 'foo', 'value' => 123.456789, 'active' => 1],
118
-				['id' => 3, 'hash' => md5(3), 'data' => 'foo', 'value' => 123.456,    'active' => 0],
118
+				['id' => 3, 'hash' => md5(3), 'data' => 'foo', 'value' => 123.456, 'active' => 0],
119 119
 			])
120 120
 		;
121 121
 
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
 		$select = $this->statement->select;
172 172
 		$select
173 173
 			->from([self::TEST_TABLENAME])
174
-			->where('id', [1,2,3], 'in')
174
+			->where('id', [1, 2, 3], 'in')
175 175
 			->orderBy(['hash' => ['desc', 'lower']]);
176 176
 #		print_r(PHP_EOL.$select->sql().PHP_EOL);
177 177
 		$result = $select->execute();
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
 #		print_r(PHP_EOL.$update->sql().PHP_EOL);
214 214
 		$this->assertTrue($update->execute());
215 215
 
216
-		$r = $this->statement->select->from([self::TEST_TABLENAME])->where('id' ,1)->execute();
216
+		$r = $this->statement->select->from([self::TEST_TABLENAME])->where('id', 1)->execute();
217 217
 
218 218
 		$this->assertSame('bar', $r[0]->data);
219 219
 		$this->assertSame(42.42, (float)$r[0]->value);
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
 		$this->assertTrue($delete->execute());
248 248
 
249 249
 		$r = $this->statement->select->from([self::TEST_TABLENAME])->execute();
250
-		$this->assertCount(3,  $r);
250
+		$this->assertCount(3, $r);
251 251
 	}
252 252
 
253 253
 	/**
Please login to merge, or discard this patch.
src/Query/Dialects/Firebird/Select.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -43,8 +43,8 @@
 block discarded – undo
43 43
 		$sql  = 'SELECT ';
44 44
 		$sql .= !is_null($this->limit) ? 'FIRST ? SKIP ? ' : '';
45 45
 		$sql .= $this->distinct ? 'DISTINCT ' : '';
46
-		$sql .= !empty($this->cols) ? implode($glue , $this->cols).PHP_EOL : '* ';
47
-		$sql .= 'FROM '.implode($glue , $this->from);
46
+		$sql .= !empty($this->cols) ? implode($glue, $this->cols).PHP_EOL : '* ';
47
+		$sql .= 'FROM '.implode($glue, $this->from);
48 48
 		$sql .= $this->_getWhere();
49 49
 		$sql .= !empty($this->groupby) ? PHP_EOL.'GROUP BY '.implode($glue, $this->groupby) : '';
50 50
 		$sql .= !empty($this->orderby) ? PHP_EOL.'ORDER BY '.implode($glue, $this->orderby) : '';
Please login to merge, or discard this patch.