Skip to content

Commit

Permalink
revert not in pr
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Apr 18, 2019
1 parent 91a6afe commit 04a547e
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 21 deletions.
11 changes: 0 additions & 11 deletions src/Illuminate/Database/Query/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -616,17 +616,6 @@ public function where($column, $operator = null, $value = null, $boolean = 'and'
return $this->whereNested($column, $boolean);
}

// If the operator is a literal string 'in' or 'not in', we will assume that
// the developer wants to use the "whereIn / whereNotIn" methods for this
// operation and proxy the query through those methods from this point.
if ($operator == 'in') {
return $this->whereIn($column, $value, $boolean);
}

if ($operator == 'not in') {
return $this->whereNotIn($column, $value, $boolean);
}

// If the given operator is not found in the list of valid operators we will
// assume that the developer is just short-cutting the '=' operators and
// we will set the operators to '=' and set the values appropriately.
Expand Down
10 changes: 0 additions & 10 deletions tests/Database/DatabaseQueryBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -644,11 +644,6 @@ public function testBasicWhereIns()
$this->assertEquals('select * from "users" where "id" in (?, ?, ?)', $builder->toSql());
$this->assertEquals([0 => 1, 1 => 2, 2 => 3], $builder->getBindings());

$builder = $this->getBuilder();
$builder->select('*')->from('users')->where('id', 'in', [1, 2, 3]);
$this->assertEquals('select * from "users" where "id" in (?, ?, ?)', $builder->toSql());
$this->assertEquals([0 => 1, 1 => 2, 2 => 3], $builder->getBindings());

$builder = $this->getBuilder();
$builder->select('*')->from('users')->where('id', '=', 1)->orWhereIn('id', [1, 2, 3]);
$this->assertEquals('select * from "users" where "id" = ? or "id" in (?, ?, ?)', $builder->toSql());
Expand All @@ -662,11 +657,6 @@ public function testBasicWhereNotIns()
$this->assertEquals('select * from "users" where "id" not in (?, ?, ?)', $builder->toSql());
$this->assertEquals([0 => 1, 1 => 2, 2 => 3], $builder->getBindings());

$builder = $this->getBuilder();
$builder->select('*')->from('users')->where('id', 'not in', [1, 2, 3]);
$this->assertEquals('select * from "users" where "id" not in (?, ?, ?)', $builder->toSql());
$this->assertEquals([0 => 1, 1 => 2, 2 => 3], $builder->getBindings());

$builder = $this->getBuilder();
$builder->select('*')->from('users')->where('id', '=', 1)->orWhereNotIn('id', [1, 2, 3]);
$this->assertEquals('select * from "users" where "id" = ? or "id" not in (?, ?, ?)', $builder->toSql());
Expand Down

1 comment on commit 04a547e

@pns2050
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.