Skip to content

Commit

Permalink
fix shipping calculators to return integers
Browse files Browse the repository at this point in the history
  • Loading branch information
Dukecz committed Feb 13, 2015
1 parent 8457644 commit f3fbe53
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class FlatRateCalculator extends Calculator
*/
public function calculate(ShippingSubjectInterface $subject, array $configuration)
{
return $configuration['amount'];
return (int)$configuration['amount'];
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function calculate(ShippingSubjectInterface $subject, array $configuratio
$additionalItems = $additionalItemLimit >= $additionalItems ? $additionalItems : $additionalItemLimit;
}

return $firstItemCost + ($additionalItems * $additionalItemCost);
return (int)($firstItemCost + ($additionalItems * $additionalItemCost));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class PerItemRateCalculator extends Calculator
*/
public function calculate(ShippingSubjectInterface $subject, array $configuration)
{
return $configuration['amount'] * $subject->getShippingItemCount();
return (int)($configuration['amount'] * $subject->getShippingItemCount());
}

/**
Expand Down

0 comments on commit f3fbe53

Please sign in to comment.