| Total Complexity | 4 |
| Total Lines | 23 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 22 | class Action extends AbstractAction |
||
| 23 | { |
||
| 24 | /** |
||
| 25 | * {@inheritdoc} |
||
| 26 | */ |
||
| 27 | 21 | public function isApplicable(PriceInterface $price): bool |
|
| 28 | { |
||
| 29 | 21 | return $this->saleOccurred() && $price->isApplicable($this); |
|
| 30 | } |
||
| 31 | |||
| 32 | /** |
||
| 33 | * // TODO: think about moving to Sale::isOccurred() |
||
| 34 | * |
||
| 35 | * @return bool whether Sale that belongs to current Action has been already occurred |
||
| 36 | * @throws \Exception |
||
| 37 | */ |
||
| 38 | 21 | private function saleOccurred(): bool |
|
| 45 | } |
||
| 46 | } |
||
| 47 |