| 1 | <?php |
||
| 21 | trait FormulaChargeModifierTrait |
||
| 22 | { |
||
| 23 | /** |
||
| 24 | * @var ChargeModifier|null |
||
| 25 | */ |
||
| 26 | protected $formula; |
||
| 27 | |||
| 28 | /** {@inheritdoc} */ |
||
| 29 | public function modifyCharge(?ChargeInterface $charge, ActionInterface $action): array |
||
| 30 | { |
||
| 31 | return $this->formula ? $this->formula->modifyCharge($charge, $action) : []; |
||
| 32 | } |
||
| 33 | |||
| 34 | /** {@inheritdoc} */ |
||
| 35 | public function isSuitable(?ChargeInterface $charge, ActionInterface $action): bool |
||
| 36 | { |
||
| 37 | return $this->formula ? $this->formula->isSuitable($charge, $action) : false; |
||
| 38 | } |
||
| 39 | |||
| 40 | public function setFormula(ChargeModifier $formula) |
||
| 44 | } |
||
| 45 |