Skip to content

Commit 09cc149

Browse files
committed
Formatting
1 parent 2a381e7 commit 09cc149

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

src/Illuminate/Database/Query/Builder.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2198,17 +2198,17 @@ public function dynamicWhereColumns($matches, $parameters)
21982198
$boolean = (strtolower($matches[1]) === 'or') ? 'or' : 'and';
21992199

22002200
// If the type is whereNone, then we need to negate the nested where clause
2201-
if($whereColumnsClause === 'None'){
2201+
if ($whereColumnsClause === 'None') {
22022202
$boolean .= ' not';
22032203
}
22042204

22052205
// We determine the where clause that should be used on all the columns
22062206
$whereClause = Str::start($matches[4], $whereColumnsClause === 'All' ? 'where' : 'orWhere');
2207-
if(!method_exists($this,$whereClause)){
2207+
if (! method_exists($this, $whereClause)) {
22082208
static::throwBadMethodCallException($matches[0]);
22092209
}
22102210

2211-
$this->whereNested(function ($query) use ($parameters, $whereClause, $matches) {
2211+
$this->whereNested(function ($query) use ($parameters, $whereClause) {
22122212
// We extract the columns, so that we are left with one array containing the columns, and one holding the parameters
22132213
$columns = (array) array_shift($parameters);
22142214
foreach ($columns as $column) {
@@ -4394,7 +4394,7 @@ public function __call($method, $parameters)
43944394

43954395
$pattern = '/^(or)?(Where)(Any|All|None)(.+)$/i';
43964396
if (preg_match($pattern, $method, $matches) === 1) {
4397-
return $this->dynamicWhereColumns($matches, $parameters );
4397+
return $this->dynamicWhereColumns($matches, $parameters);
43984398
}
43994399

44004400
if (str_starts_with($method, 'where')) {

tests/Database/DatabaseQueryBuilderTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1384,7 +1384,7 @@ public function testDynamicWhereAll()
13841384
$this->assertEquals([100, 200, 100, 200], $builder->getBindings());
13851385

13861386
$builder = $this->getBuilder();
1387-
$builder->select('*')->from('products')->where('name', 'like', '%shirt%')->orWhereAllNotBetween(['price', 'discounted_price'], [100, 200]);
1387+
$builder->select('*')->from('products')->where('name', 'like', '%shirt%')->orWhereAllNotBetween(['price', 'discounted_price'], [100, 200]);
13881388
$this->assertSame('select * from "products" where "name" like ? or ("price" not between ? and ? and "discounted_price" not between ? and ?)', $builder->toSql());
13891389
$this->assertEquals(['%shirt%', 100, 200, 100, 200], $builder->getBindings());
13901390

@@ -1425,7 +1425,6 @@ public function testBuilderThrowsExpectedExceptionWithUndefinedWhereAllMethod()
14251425

14261426
$builder = $this->getBuilder();
14271427
$builder->select('*')->from('users')->where('name', 'John')->orWhereAllHelloWorld(['id']);
1428-
14291428
}
14301429

14311430
public function testDynamicWhereAny()
@@ -1474,7 +1473,7 @@ public function testDynamicWhereNone()
14741473
$builder = $this->getBuilder();
14751474
$builder->select('*')->from('users')->where('name', 'John')->orWhereNoneIn(['id', 'parent_id'], [1, 2, 3]);
14761475
$this->assertSame('select * from "users" where "name" = ? or not ("id" in (?, ?, ?) or "parent_id" in (?, ?, ?))', $builder->toSql());
1477-
$this->assertEquals(['John', 1,2,3,1,2,3], $builder->getBindings());
1476+
$this->assertEquals(['John', 1, 2, 3, 1, 2, 3], $builder->getBindings());
14781477

14791478
$builder = $this->getBuilder();
14801479
$builder->select('*')->from('users')->where('name', 'John')->orWhereNoneNull(['last_name', 'email']);

0 commit comments

Comments
 (0)