Skip to content

Commit 2c814b5

Browse files
authored
support to the case where there is no 0th array
As it stands now, this would be an error in this case. ``` $values = [ 2 => [ 'aa' ], ] ```
1 parent 294bdf1 commit 2c814b5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Batch.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ public function insert(Model $table, array $columns, array $values, int $batchSi
271271
{
272272
// no need for the old validation since we now use type hint that supports from php 7.0
273273
// but I kept this one
274-
if (count($columns) !== count($values[0])) {
274+
if (count($columns) !== count(current($values)) {
275275
return false;
276276
}
277277

0 commit comments

Comments
 (0)