Skip to content

Commit d7d2a44

Browse files
AdalbertMemSQLgithub-actions[bot]
authored andcommitted
Fix code styling
1 parent 0b2e1eb commit d7d2a44

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

src/Query/Grammar.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function compileOptions(array $options): string
2626
if (! empty($optionString)) {
2727
$optionString .= ',';
2828
}
29-
$optionString .= $key . '=' . $value;
29+
$optionString .= $key.'='.$value;
3030
}
3131

3232
return "OPTION ({$optionString})";
@@ -128,7 +128,7 @@ protected function whereNull(Builder $query, $where)
128128
if ($this->isJsonSelector($columnValue)) {
129129
[$field, $path] = $this->wrapJsonFieldAndPath($where['column']);
130130

131-
return '(JSON_EXTRACT_JSON(' . $field . $path . ') IS NULL OR JSON_GET_TYPE(JSON_EXTRACT_JSON(' . $field . $path . ')) = \'NULL\')';
131+
return '(JSON_EXTRACT_JSON('.$field.$path.') IS NULL OR JSON_GET_TYPE(JSON_EXTRACT_JSON('.$field.$path.')) = \'NULL\')';
132132
}
133133

134134
return parent::whereNull($query, $where);
@@ -140,7 +140,7 @@ protected function whereNotNull(Builder $query, $where)
140140
if ($this->isJsonSelector($columnValue)) {
141141
[$field, $path] = $this->wrapJsonFieldAndPath($where['column']);
142142

143-
return '(JSON_EXTRACT_JSON(' . $field . $path . ') IS NOT NULL AND JSON_GET_TYPE(JSON_EXTRACT_JSON(' . $field . $path . ')) != \'NULL\')';
143+
return '(JSON_EXTRACT_JSON('.$field.$path.') IS NOT NULL AND JSON_GET_TYPE(JSON_EXTRACT_JSON('.$field.$path.')) != \'NULL\')';
144144
}
145145

146146
return parent::whereNotNull($query, $where);
@@ -192,7 +192,7 @@ protected function wrapJsonFieldAndPath($column)
192192
return "'$part'";
193193
}, $parts);
194194

195-
$path = count($parts) ? ', ' . implode(', ', $parts) : '';
195+
$path = count($parts) ? ', '.implode(', ', $parts) : '';
196196

197197
return [$field, $path];
198198
}
@@ -205,7 +205,7 @@ protected function wrapJsonFieldAndPath($column)
205205
*/
206206
protected function wrapUnion($sql)
207207
{
208-
return 'SELECT * FROM (' . $sql . ')';
208+
return 'SELECT * FROM ('.$sql.')';
209209
}
210210

211211
/**
@@ -233,7 +233,7 @@ protected function compileUnion(array $union)
233233
{
234234
$conjunction = $union['all'] ? ' union all ' : ' union ';
235235

236-
return $conjunction . '(' . $union['query']->toSql() . ')';
236+
return $conjunction.'('.$union['query']->toSql().')';
237237
}
238238

239239
/**
@@ -252,18 +252,18 @@ public function compileSelect(Builder $query)
252252
}
253253

254254
if (! empty($query->unionOrders) || isset($query->unionLimit) || isset($query->unionOffset)) {
255-
$sql = 'SELECT * FROM (' . $sql . ') ';
255+
$sql = 'SELECT * FROM ('.$sql.') ';
256256

257257
if (! empty($query->unionOrders)) {
258-
$sql .= ' ' . $this->compileOrders($query, $query->unionOrders);
258+
$sql .= ' '.$this->compileOrders($query, $query->unionOrders);
259259
}
260260

261261
if (isset($query->unionLimit)) {
262-
$sql .= ' ' . $this->compileLimit($query, $query->unionLimit);
262+
$sql .= ' '.$this->compileLimit($query, $query->unionLimit);
263263
}
264264

265265
if (isset($query->unionOffset)) {
266-
$sql .= ' ' . $this->compileUnionOffset($query, $query->unionOffset);
266+
$sql .= ' '.$this->compileUnionOffset($query, $query->unionOffset);
267267
}
268268
}
269269

@@ -297,10 +297,10 @@ private function compileOffsetWithLimit($offset, $limit): string
297297
// Add a huge LIMIT clause
298298
if (! isset($limit)) {
299299
// 9223372036854775807 - max 64-bit integer
300-
return ' LIMIT 9223372036854775807 OFFSET ' . (int) $offset;
300+
return ' LIMIT 9223372036854775807 OFFSET '.(int) $offset;
301301
}
302302

303-
return ' OFFSET ' . (int) $offset;
303+
return ' OFFSET '.(int) $offset;
304304
}
305305

306306
/**

tests/Hybrid/Json/JsonWhereTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ public function where_null_raw()
134134
$query = DB::table('test')->whereNull(DB::raw('(SELECT NULL)'))->orderBy('id');
135135

136136
$this->assertEquals(
137-
"select * from `test` where (SELECT NULL) is null order by `id` asc",
137+
'select * from `test` where (SELECT NULL) is null order by `id` asc',
138138
$query->toSql()
139139
);
140140

@@ -187,7 +187,7 @@ public function where_not_null_raw()
187187
$query = DB::table('test')->whereNotNull(DB::raw('(SELECT 1)'))->orderBy('id');
188188

189189
$this->assertEquals(
190-
"select * from `test` where (SELECT 1) is not null order by `id` asc",
190+
'select * from `test` where (SELECT 1) is not null order by `id` asc',
191191
$query->toSql()
192192
);
193193

0 commit comments

Comments
 (0)