| Conditions | 1 |
| Paths | 1 |
| Total Lines | 7 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 1 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 19 | 5 | public function calc(float $value): float |
|
| 20 | { |
||
| 21 | 5 | return match ($this->{static::$bindable->getTypeColumn()}) { |
|
| 22 | 5 | static::TYPE_SUBTRACTION => $this->subtract($value), |
|
|
|
|||
| 23 | 4 | static::TYPE_PERCENTAGE => $this->percentage($value), |
|
| 24 | 2 | static::TYPE_FIXED => $this->fixedPrice(), |
|
| 25 | 5 | default => throw new InvalidCouponTypeException, |
|
| 26 | }; |
||
| 63 |