Skip to content
This repository was archived by the owner on Aug 22, 2023. It is now read-only.

Commit 8c918f1

Browse files
committed
wording for exception message
1 parent 68fee51 commit 8c918f1

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/Query/Builder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -567,10 +567,10 @@ public function whereBetween($column, iterable $values, $boolean = 'and', $not =
567567

568568
if (is_array($values)) {
569569
if (! array_is_list($values)) {
570-
throw new \InvalidArgumentException('Between array must a list with 2 elements: [min, max]');
570+
throw new \InvalidArgumentException('Between $values must be a list with exactly two elements: [min, max]');
571571
}
572572
if (count($values) !== 2) {
573-
throw new \InvalidArgumentException('Between array must have 2 elements: [min, max]');
573+
throw new \InvalidArgumentException('Between $values must have exactly two elements: [min, max]');
574574
}
575575
}
576576

tests/Query/BuilderTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -275,25 +275,25 @@ public static function provideExceptions(): iterable
275275
/** @see DatabaseQueryBuilderTest::testWhereBetweens */
276276
yield 'whereBetween array too short' => [
277277
\InvalidArgumentException::class,
278-
'Between array must have 2 elements: [min, max]',
278+
'Between $values must have exactly two elements: [min, max]',
279279
fn (Builder $builder) => $builder->whereBetween('id', [1]),
280280
];
281281

282282
yield 'whereBetween array too long' => [
283283
\InvalidArgumentException::class,
284-
'Between array must have 2 elements: [min, max]',
284+
'Between $values must have exactly two elements: [min, max]',
285285
fn (Builder $builder) => $builder->whereBetween('id', [1, 2, 3]),
286286
];
287287

288288
yield 'whereBetween collection too long' => [
289289
\InvalidArgumentException::class,
290-
'Between array must have 2 elements: [min, max]',
290+
'Between $values must have exactly two elements: [min, max]',
291291
fn (Builder $builder) => $builder->whereBetween('id', new Collection([1, 2, 3])),
292292
];
293293

294294
yield 'whereBetween array is not a list' => [
295295
\InvalidArgumentException::class,
296-
'Between array must a list with 2 elements: [min, max]',
296+
'Between $values must be a list with exactly two elements: [min, max]',
297297
fn (Builder $builder) => $builder->whereBetween('id', ['min' => 1, 'max' => 2]),
298298
];
299299

0 commit comments

Comments
 (0)