Skip to content

Commit

Permalink
fix: pair and chunk operation when using empty input (#327)
Browse files Browse the repository at this point in the history
Fix #326
  • Loading branch information
drupol authored Dec 1, 2023
1 parent bafda9e commit 58fd5da
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Operation/Chunk.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ static function (iterable $iterable) use ($sizes): Generator {
$values = [$value];
}

yield $values;
if ([] !== $values) {
yield $values;
}
};
}
}
7 changes: 7 additions & 0 deletions tests/unit/Traits/GenericCollectionProviders.php
Original file line number Diff line number Diff line change
Expand Up @@ -3220,6 +3220,13 @@ public static function pairOperationProvider()
$input,
$output(),
];

yield [
$operation,
[],
[],
[],
];
}

public static function permutateOperationProvider()
Expand Down

0 comments on commit 58fd5da

Please sign in to comment.