Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/Price.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ public function perUnit(Money $amount)
$parts = floor($this->units);

$remainder = $amount->multipliedBy($this->units - $parts, RoundingMode::FLOOR);

$allocated = $amount->minus($remainder);

return Money::min(...$allocated->split($parts));
Expand Down Expand Up @@ -239,7 +239,7 @@ public function invalidate()
* Launch the total price calculator only if
* it does not yet exist or has been invalidated.
*
* @return void
* @return \Whitecube\Price\Calculator
*/
public function build()
{
Expand All @@ -253,7 +253,7 @@ public function build()
}

/**
* Convert this price object into a readable
* Convert this price object into a readable
* total & inclusive money string
*
* @return string
Expand Down Expand Up @@ -303,8 +303,8 @@ public static function json($value)
}

$base = Money::ofMinor($value['base'], $value['currency']);

return (new static($base, $value['units']))
->setVat($value['vat']);
}
}
}