Completed
Push — master ( 34699d...93c711 )
by Joas
30:13
created
lib/private/DB/QueryBuilder/ExpressionBuilder/MySqlExpressionBuilder.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 		parent::__construct($connection, $queryBuilder, $logger);
21 21
 
22 22
 		$params = $connection->getInner()->getParams();
23
-		$this->collation = $params['collation'] ?? (($params['charset'] ?? 'utf8') . '_general_ci');
23
+		$this->collation = $params['collation'] ?? (($params['charset'] ?? 'utf8').'_general_ci');
24 24
 	}
25 25
 
26 26
 	/**
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 	public function iLike($x, $y, $type = null): string {
30 30
 		$x = $this->helper->quoteColumnName($x);
31 31
 		$y = $this->helper->quoteColumnName($y);
32
-		return $this->expressionBuilder->comparison($x, ' COLLATE ' . $this->collation . ' LIKE', $y);
32
+		return $this->expressionBuilder->comparison($x, ' COLLATE '.$this->collation.' LIKE', $y);
33 33
 	}
34 34
 
35 35
 	/**
@@ -43,9 +43,9 @@  discard block
 block discarded – undo
43 43
 	public function castColumn($column, $type): IQueryFunction {
44 44
 		switch ($type) {
45 45
 			case IQueryBuilder::PARAM_STR:
46
-				return new QueryFunction('CAST(' . $this->helper->quoteColumnName($column) . ' AS CHAR)');
46
+				return new QueryFunction('CAST('.$this->helper->quoteColumnName($column).' AS CHAR)');
47 47
 			case IQueryBuilder::PARAM_JSON:
48
-				return new QueryFunction('CAST(' . $this->helper->quoteColumnName($column) . ' AS JSON)');
48
+				return new QueryFunction('CAST('.$this->helper->quoteColumnName($column).' AS JSON)');
49 49
 			default:
50 50
 				return parent::castColumn($column, $type);
51 51
 		}
Please login to merge, or discard this patch.
lib/private/DB/QueryBuilder/ExpressionBuilder/PgSqlExpressionBuilder.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -25,10 +25,10 @@
 block discarded – undo
25 25
 	public function castColumn($column, $type): IQueryFunction {
26 26
 		switch ($type) {
27 27
 			case IQueryBuilder::PARAM_INT:
28
-				return new QueryFunction('CAST(' . $this->helper->quoteColumnName($column) . ' AS BIGINT)');
28
+				return new QueryFunction('CAST('.$this->helper->quoteColumnName($column).' AS BIGINT)');
29 29
 			case IQueryBuilder::PARAM_STR:
30 30
 			case IQueryBuilder::PARAM_JSON:
31
-				return new QueryFunction('CAST(' . $this->helper->quoteColumnName($column) . ' AS TEXT)');
31
+				return new QueryFunction('CAST('.$this->helper->quoteColumnName($column).' AS TEXT)');
32 32
 			default:
33 33
 				return parent::castColumn($column, $type);
34 34
 		}
Please login to merge, or discard this patch.
lib/private/DB/QueryBuilder/ExpressionBuilder/OCIExpressionBuilder.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 		if ($type === IQueryBuilder::PARAM_JSON) {
35 35
 			$x = $this->prepareColumn($x, $type);
36 36
 			$y = $this->prepareColumn($y, $type);
37
-			return (string)(new QueryFunction('JSON_EQUAL(' . $x . ',' . $y . ')'));
37
+			return (string) (new QueryFunction('JSON_EQUAL('.$x.','.$y.')'));
38 38
 		}
39 39
 
40 40
 		return parent::eq($x, $y, $type);
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 		if ($type === IQueryBuilder::PARAM_JSON) {
48 48
 			$x = $this->prepareColumn($x, $type);
49 49
 			$y = $this->prepareColumn($y, $type);
50
-			return (string)(new QueryFunction('NOT JSON_EQUAL(' . $x . ',' . $y . ')'));
50
+			return (string) (new QueryFunction('NOT JSON_EQUAL('.$x.','.$y.')'));
51 51
 		}
52 52
 
53 53
 		return parent::neq($x, $y, $type);
@@ -106,11 +106,11 @@  discard block
 block discarded – undo
106 106
 	public function castColumn($column, $type): IQueryFunction {
107 107
 		if ($type === IQueryBuilder::PARAM_STR) {
108 108
 			$column = $this->helper->quoteColumnName($column);
109
-			return new QueryFunction('to_char(' . $column . ')');
109
+			return new QueryFunction('to_char('.$column.')');
110 110
 		}
111 111
 		if ($type === IQueryBuilder::PARAM_INT) {
112 112
 			$column = $this->helper->quoteColumnName($column);
113
-			return new QueryFunction('to_number(to_char(' . $column . '))');
113
+			return new QueryFunction('to_number(to_char('.$column.'))');
114 114
 		}
115 115
 
116 116
 		return parent::castColumn($column, $type);
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
 	 * @inheritdoc
121 121
 	 */
122 122
 	public function like($x, $y, $type = null): string {
123
-		return parent::like($x, $y, $type) . " ESCAPE '\\'";
123
+		return parent::like($x, $y, $type)." ESCAPE '\\'";
124 124
 	}
125 125
 
126 126
 	/**
Please login to merge, or discard this patch.
tests/lib/DB/QueryBuilder/ExpressionBuilderDBTest.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
 			->set('configvalue',
112 112
 				$query->expr()->castColumn(
113 113
 					$query->createFunction(
114
-						'(' . $query->expr()->castColumn('configvalue', IQueryBuilder::PARAM_INT)
114
+						'('.$query->expr()->castColumn('configvalue', IQueryBuilder::PARAM_INT)
115 115
 						. ' + 1)'
116 116
 					), IQueryBuilder::PARAM_STR
117 117
 				)
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
 			$version = $result->fetchOne();
148 148
 			$result->closeCursor();
149 149
 			if (str_starts_with($version, '11.')) {
150
-				$this->markTestSkipped('JSON is not supported on Oracle 11, skipping until deprecation was clarified: ' . $version);
150
+				$this->markTestSkipped('JSON is not supported on Oracle 11, skipping until deprecation was clarified: '.$version);
151 151
 			}
152 152
 		}
153 153
 
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
 		$entries = $result->fetchAll();
188 188
 		$result->closeCursor();
189 189
 		self::assertCount(1, $entries);
190
-		self::assertEquals([['permissions','after']], json_decode($entries[0]['attributes'], true));
190
+		self::assertEquals([['permissions', 'after']], json_decode($entries[0]['attributes'], true));
191 191
 	}
192 192
 
193 193
 	public function testDateTimeEquals(): void {
@@ -248,8 +248,8 @@  discard block
 block discarded – undo
248 248
 		$query->insert('appconfig')
249 249
 			->values([
250 250
 				'appid' => $query->createNamedParameter($appId),
251
-				'configkey' => $query->createNamedParameter((string)$key),
252
-				'configvalue' => $query->createNamedParameter((string)$value),
251
+				'configkey' => $query->createNamedParameter((string) $key),
252
+				'configvalue' => $query->createNamedParameter((string) $value),
253 253
 			])
254 254
 			->executeStatement();
255 255
 	}
@@ -262,11 +262,11 @@  discard block
 block discarded – undo
262 262
 		$prefix = Server::get(IConfig::class)->getSystemValueString('dbtableprefix', 'oc_');
263 263
 		$schema = $this->connection->createSchema();
264 264
 		try {
265
-			$schema->getTable($prefix . 'testing');
265
+			$schema->getTable($prefix.'testing');
266 266
 			$this->connection->getQueryBuilder()->delete('testing')->executeStatement();
267 267
 		} catch (SchemaException $e) {
268 268
 			$this->schemaSetup = true;
269
-			$table = $schema->createTable($prefix . 'testing');
269
+			$table = $schema->createTable($prefix.'testing');
270 270
 			$table->addColumn('id', Types::BIGINT, [
271 271
 				'autoincrement' => true,
272 272
 				'notnull' => true,
Please login to merge, or discard this patch.