Skip to content

Commit f217567

Browse files
committed
Fix where(array|callable) detection
1 parent d21acd5 commit f217567

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

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

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

0 commit comments

Comments
 (0)