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 | 25 | public function isApplicable(PriceInterface $price): bool |
|
28 | { |
||
29 | 25 | return $this->saleOccurred() && $price->isApplicable($this); |
|
30 | } |
||
31 | |||
32 | /** |
||
33 | * // TODO: think about moving to Sale::isOccurred() |
||
34 | * |
||
35 | * @throws \Exception |
||
36 | * @return bool whether Sale that belongs to current Action occurs in current month or earlier |
||
37 | */ |
||
38 | 25 | private function saleOccurred(): bool |
|
45 | } |
||
46 | } |
||
47 |