Skip to content

Commit e3de27e

Browse files
committed
Revert column type detection, as the number of arguments is unreliable
1 parent 03265ec commit e3de27e

File tree

2 files changed

+0
-10
lines changed

2 files changed

+0
-10
lines changed

src/Query/Builder.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -984,10 +984,6 @@ public function where($column, $operator = null, $value = null, $boolean = 'and'
984984
throw new ArgumentCountError(sprintf('Too few arguments to function %s(%s), 1 passed and at least 2 expected when the 1st is not an array or a callable', __METHOD__, var_export($column, true)));
985985
}
986986

987-
if (! is_int($column) && ! is_string($column)) {
988-
throw new InvalidArgumentException(sprintf('First argument of %s must be a column name as "string". Got "%s"', __METHOD__, get_debug_type($column)));
989-
}
990-
991987
return parent::where(...$params);
992988
}
993989

tests/Query/BuilderTest.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1219,12 +1219,6 @@ public static function provideExceptions(): iterable
12191219
'Invalid time format, expected HH:MM:SS, HH:MM or HH, got "stdClass"',
12201220
fn (Builder $builder) => $builder->whereTime('created_at', new stdClass()),
12211221
];
1222-
1223-
yield 'where invalid column type' => [
1224-
InvalidArgumentException::class,
1225-
'First argument of MongoDB\Laravel\Query\Builder::where must be a column name as "string". Got "float"',
1226-
fn (Builder $builder) => $builder->where(2.3, '>', 1),
1227-
];
12281222
}
12291223

12301224
/** @dataProvider getEloquentMethodsNotSupported */

0 commit comments

Comments
 (0)