| 1 | <?php |
||
| 16 | class Percentage implements CouponContract |
||
| 17 | { |
||
| 18 | use CouponTrait; |
||
| 19 | |||
| 20 | public $code; |
||
| 21 | public $value; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * Percentage constructor. |
||
| 25 | * |
||
| 26 | * @param $code |
||
| 27 | * @param $value |
||
| 28 | * @param array $options |
||
| 29 | */ |
||
| 30 | public function __construct($code, $value, $options = []) |
||
| 37 | |||
| 38 | /** |
||
| 39 | * Gets the discount amount. |
||
| 40 | * |
||
| 41 | * @param $throwErrors boolean this allows us to capture errors in our code if we wish, |
||
| 42 | * that way we can spit out why the coupon has failed |
||
| 43 | * |
||
| 44 | * @return string |
||
| 45 | */ |
||
| 46 | public function discount($throwErrors = false) |
||
| 55 | |||
| 56 | /** |
||
| 57 | * @return mixed |
||
| 58 | */ |
||
| 59 | public function displayValue() |
||
| 63 | } |
||
| 64 |