Skip to content

Commit

Permalink
Use variadics for Money::allocate()
Browse files Browse the repository at this point in the history
  • Loading branch information
BenMorel committed Sep 28, 2017
1 parent e2faacb commit 0a207b4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Money.php
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ public function quotientAndRemainder($that)
*
* @return Money[]
*/
public function allocate(array $ratios)
public function allocate(...$ratios)
{
$total = array_sum($ratios);
$step = $this->context->getStep();
Expand Down
2 changes: 1 addition & 1 deletion tests/MoneyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ public function testQuotientAndRemainderThrowExceptionOnDecimal()
*/
public function testAllocate(Money $money, array $ratios, array $expected)
{
$monies = $money->allocate($ratios);
$monies = $money->allocate(...$ratios);
$this->assertMoniesAre($expected, $monies);
}

Expand Down

0 comments on commit 0a207b4

Please sign in to comment.