Skip to content

Commit 97de613

Browse files
committed
Fix where(array|callable) detection
1 parent 7103d06 commit 97de613

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Query/Builder.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@
4545
use function implode;
4646
use function in_array;
4747
use function is_array;
48+
use function is_callable;
4849
use function is_int;
49-
use function is_scalar;
5050
use function is_string;
5151
use function md5;
5252
use function preg_match;
@@ -962,8 +962,8 @@ public function where($column, $operator = null, $value = null, $boolean = 'and'
962962
}
963963
}
964964

965-
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 not an array.', __METHOD__, var_export($column, true)));
965+
if (func_num_args() === 1 && ! is_array($column) && ! is_callable($column)) {
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 or a callable', __METHOD__, var_export($column, true)));
967967
}
968968

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

0 commit comments

Comments
 (0)