Skip to content

Commit b2ebded

Browse files
committed
Fix exception message
1 parent da7d5d7 commit b2ebded

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
@@ -968,7 +968,7 @@ public function where($column, $operator = null, $value = null, $boolean = 'and'
968968
}
969969

970970
if (func_num_args() === 1 && is_scalar($column)) {
971-
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)));
971+
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)));
972972
}
973973

974974
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)