Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class dph
- {
- private $dph;
- public function __construct($dph)
- {
- $this->dph = $dph;
- }
- public function calculatePrice($price)
- {
- // doufám že ten vzoreček mám správně :))
- return $price + ((100/$price) * $this->dph);
- }
- public function calculatePrices(array $prices)
- {
- foreach ($prices as &$price) {
- $price = $this->calculatePrice($price);
- }
- return $prices;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment