Skip to content

Commit 71d4656

Browse files
committed
Fix exception message
1 parent 5a88fb6 commit 71d4656

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Query/Builder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -963,7 +963,7 @@ public function where($column, $operator = null, $value = null, $boolean = 'and'
963963
}
964964

965965
if (func_num_args() === 1 && is_scalar($column)) {
966-
throw new ArgumentCountError(sprintf('Too few arguments to function %s(%s), 1 passed and at least 2 expected when the 1st is a scalar.', __METHOD__, var_export($column, true)));
966+
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.', __METHOD__, var_export($column, true)));
967967
}
968968

969969
return parent::where(...$params);

tests/Query/BuilderTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1180,13 +1180,13 @@ public static function provideExceptions(): iterable
11801180

11811181
yield 'find with single string argument' => [
11821182
ArgumentCountError::class,
1183-
'Too few arguments to function MongoDB\Laravel\Query\Builder::where(\'foo\'), 1 passed and at least 2 expected when the 1st is a scalar',
1183+
'Too few arguments to function MongoDB\Laravel\Query\Builder::where(\'foo\'), 1 passed and at least 2 expected when the 1st is not an array',
11841184
fn (Builder $builder) => $builder->where('foo'),
11851185
];
11861186

11871187
yield 'find with single numeric argument' => [
11881188
ArgumentCountError::class,
1189-
'Too few arguments to function MongoDB\Laravel\Query\Builder::where(123), 1 passed and at least 2 expected when the 1st is a scalar',
1189+
'Too few arguments to function MongoDB\Laravel\Query\Builder::where(123), 1 passed and at least 2 expected when the 1st is not an array',
11901190
fn (Builder $builder) => $builder->where(123),
11911191
];
11921192

0 commit comments

Comments
 (0)