Skip to content

[Bug]: make remainder optional when empty #1

@nickfls

Description

@nickfls

What happened?

When shard() exhausts collection and the reminder is empty, it should not be appended, as it is always empty

How to reproduce the bug

collect([1,2])->shard([
    fn($x) => $x === 1,
    fn($x) => $x === 2,
])

Should return explicitly two collections, without remainder

Package Version

1.0.0

PHP Version

8.2

Laravel Version

12

Which operating systems does this happen with?

No response

Notes

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions