Skip to content

Commit

Permalink
scanLeft and scanRight has been updated and now need two argument…
Browse files Browse the repository at this point in the history
…s instead of one.
  • Loading branch information
drupol committed Nov 2, 2022
1 parent 1233c49 commit 9355dea
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -792,7 +792,7 @@ public function scale(
return new self((new Scale())()($lowerBound)($upperBound)($wantedLowerBound)($wantedUpperBound)($base), [$this]);
}

public function scanLeft(callable $callback, $initial = null): CollectionInterface
public function scanLeft(callable $callback, $initial): CollectionInterface
{
return new self((new ScanLeft())()($callback)($initial), [$this]);
}
Expand All @@ -802,7 +802,7 @@ public function scanLeft1(callable $callback): CollectionInterface
return new self((new ScanLeft1())()($callback), [$this]);
}

public function scanRight(callable $callback, $initial = null): CollectionInterface
public function scanRight(callable $callback, $initial): CollectionInterface
{
return new self((new ScanRight())()($callback)($initial), [$this]);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Contract/Operation/ScanLeftable.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ interface ScanLeftable
*
* @return Collection<TKey, V|W>
*/
public function scanLeft(callable $callback, $initial = null): Collection;
public function scanLeft(callable $callback, $initial): Collection;
}
2 changes: 1 addition & 1 deletion src/Contract/Operation/ScanRightable.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ interface ScanRightable
*
* @return Collection<TKey, V|W>
*/
public function scanRight(callable $callback, $initial = null): Collection;
public function scanRight(callable $callback, $initial): Collection;
}
2 changes: 1 addition & 1 deletion tests/static-analysis/scanLeft.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,5 @@ function scanLeft_checkListOfSize1String(CollectionInterface $collection): void

scanLeft_checkListInt(Collection::fromIterable([1, 2, 3])->scanLeft($sum, 5));
scanLeft_checkListString(Collection::fromIterable(range('a', 'c'))->scanLeft($concat, ''));
scanLeft_checkListStringWithNull(Collection::fromIterable(range('a', 'c'))->scanLeft($concatWithNull));
scanLeft_checkListStringWithNull(Collection::fromIterable(range('a', 'c'))->scanLeft($concatWithNull, null));
scanLeft_checkListOfSize1String(Collection::fromIterable([10])->scanLeft($toString, true));
2 changes: 1 addition & 1 deletion tests/static-analysis/scanRight.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,5 @@ function scanRight_checkListOfSize1String(CollectionInterface $collection): void

scanRight_checkListInt(Collection::fromIterable([1, 2, 3])->scanRight($sum, 5));
scanRight_checkListString(Collection::fromIterable(range('a', 'c'))->scanRight($concat, ''));
scanRight_checkListStringWithNull(Collection::fromIterable(range('a', 'c'))->scanRight($concatWithNull));
scanRight_checkListStringWithNull(Collection::fromIterable(range('a', 'c'))->scanRight($concatWithNull, null));
scanRight_checkListOfSize1String(Collection::fromIterable([10])->scanRight($toString, true));

0 comments on commit 9355dea

Please sign in to comment.