Reto Refactorización WRP 36
<?php | |
class Product { | |
// ... more code | |
function amount() { | |
$product_price = $this->quantity * $this->productPrice; | |
$discountRate = 1; | |
if($product_price > 1500) { | |
$discountRate = 0.7; | |
} | |
else { | |
$discountRate = 0.95; | |
} | |
return $product_price * $discountRate; | |
} | |
// ... more code | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment