Skip to content

Commit

Permalink
Minor cosmetic update.
Browse files Browse the repository at this point in the history
  • Loading branch information
drupol committed Sep 9, 2019
1 parent e21e84f commit ae0e00b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
8 changes: 6 additions & 2 deletions spec/drupol/collection/CollectionSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -1002,14 +1002,18 @@ public function it_can_split(): void
->split(static function ($value) {
return 0 === $value % 3;
})
->map(static function (\ArrayIterator $item) {return iterator_to_array($item);})
->map(static function (\ArrayIterator $item) {
return \iterator_to_array($item);
})
->shouldIterateAs([0 => [1, 2, 3], 1 => [4, 5, 6], 2 => [7, 8, 9], 3 => [10, 11, 12], 4 => [13, 14, 15], 5 => [16, 17]]);

$this::with(\range(1, 15))
->split(static function ($value) {
return 0 === $value % 3;
})
->map(static function (\ArrayIterator $item) {return iterator_to_array($item);})
->map(static function (\ArrayIterator $item) {
return \iterator_to_array($item);
})
->shouldIterateAs([0 => [1, 2, 3], 1 => [4, 5, 6], 2 => [7, 8, 9], 3 => [10, 11, 12], 4 => [13, 14, 15]]);
}

Expand Down
2 changes: 0 additions & 2 deletions src/Contract/Splitable.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
interface Splitable
{
/**
* Get a slice of items.
*
* @param callable ...$callbacks
*
* @return \drupol\collection\Contract\Collection
Expand Down
2 changes: 1 addition & 1 deletion src/Operation/Split.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function on(iterable $collection): \Closure
}
}

if ($carry->count() !== 0) {
if (0 !== $carry->count()) {
yield $carry;
}
};
Expand Down

0 comments on commit ae0e00b

Please sign in to comment.