Skip to content

Commit

Permalink
Allow index-only call to AbstractCollection::slice()
Browse files Browse the repository at this point in the history
  • Loading branch information
giuscris committed Sep 15, 2024
1 parent f856e56 commit 1acd27a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion formwork/src/Data/AbstractCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ public function duplicates(): static
/**
* Return a copy of the collection with its items from a given index
*/
public function slice(int $index, int $length): static
public function slice(int $index, ?int $length = null): static
{
$collection = $this->clone();
$collection->data = array_slice($collection->data, $index, $length);
Expand Down

0 comments on commit 1acd27a

Please sign in to comment.