1 | <?php |
||
27 | final class FixedDiscountPromotionActionCommand extends DiscountPromotionActionCommand |
||
28 | { |
||
29 | const TYPE = 'order_fixed_discount'; |
||
30 | |||
31 | /** |
||
32 | * @var ProportionalIntegerDistributorInterface |
||
33 | */ |
||
34 | private $proportionalDistributor; |
||
35 | |||
36 | /** |
||
37 | * @var UnitsPromotionAdjustmentsApplicatorInterface |
||
38 | */ |
||
39 | private $unitsPromotionAdjustmentsApplicator; |
||
40 | |||
41 | /** |
||
42 | * @var CurrencyConverterInterface |
||
43 | */ |
||
44 | private $currencyConverter; |
||
45 | |||
46 | /** |
||
47 | * @param ProportionalIntegerDistributorInterface $proportionalIntegerDistributor |
||
48 | * @param UnitsPromotionAdjustmentsApplicatorInterface $unitsPromotionAdjustmentsApplicator |
||
49 | * @param CurrencyConverterInterface $currencyConverter |
||
50 | */ |
||
51 | public function __construct( |
||
60 | |||
61 | /** |
||
62 | * {@inheritdoc} |
||
63 | */ |
||
64 | public function execute(PromotionSubjectInterface $subject, array $configuration, PromotionInterface $promotion) |
||
88 | |||
89 | /** |
||
90 | * {@inheritdoc} |
||
91 | */ |
||
92 | public function getConfigurationFormType() |
||
96 | |||
97 | /** |
||
98 | * {@inheritdoc} |
||
99 | */ |
||
100 | protected function isConfigurationValid(array $configuration) |
||
105 | |||
106 | /** |
||
107 | * @param int $promotionSubjectTotal |
||
108 | * @param int $targetPromotionAmount |
||
109 | * |
||
110 | * @return int |
||
111 | */ |
||
112 | private function calculateAdjustmentAmount($promotionSubjectTotal, $targetPromotionAmount) |
||
116 | |||
117 | /** |
||
118 | * @param array $configuration |
||
119 | * @param string $currencyCode |
||
120 | * |
||
121 | * @return int |
||
122 | */ |
||
123 | private function getAmountByCurrencyCode(array $configuration, $currencyCode) |
||
134 | } |
||
135 |
Very long variable names usually make code harder to read. It is therefore recommended not to make variable names too verbose.