Exemplo n.º 1
0
 public function addItem(HasTax $item, int $amount = 1) : HasTax
 {
     $calculation = clone $this;
     $calculation->basePrice += $item->basePrice() * $amount;
     $calculation->taxPrice += $item->taxPrice() * $amount;
     return $calculation;
 }
Exemplo n.º 2
0
 public static function fromItem(HasTax $item) : Calculation
 {
     return new Calculation($item->basePrice(), $item->taxPrice());
 }