@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | $discountEntity = $this->createDiscountEntity(); |
65 | 65 | $this->hydrateDiscountEntity($discountConfiguratorTransfer, $discountEntity); |
66 | 66 | |
67 | - $this->handleDatabaseTransaction(function () use ($discountEntity, $discountConfiguratorTransfer) { |
|
67 | + $this->handleDatabaseTransaction(function() use ($discountEntity, $discountConfiguratorTransfer) { |
|
68 | 68 | $this->executeSaveDiscountTransaction($discountEntity, $discountConfiguratorTransfer); |
69 | 69 | }); |
70 | 70 | |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | ); |
123 | 123 | } |
124 | 124 | |
125 | - $affectedRows = $this->handleDatabaseTransaction(function () use ($discountEntity, $discountConfiguratorTransfer) { |
|
125 | + $affectedRows = $this->handleDatabaseTransaction(function() use ($discountEntity, $discountConfiguratorTransfer) { |
|
126 | 126 | return $this->executeUpdateDiscountTransaction($discountEntity, $discountConfiguratorTransfer); |
127 | 127 | }); |
128 | 128 |
@@ -191,7 +191,7 @@ |
||
191 | 191 | */ |
192 | 192 | protected function sortByDiscountAmountDescending(array $collectedDiscountsTransfer) |
193 | 193 | { |
194 | - usort($collectedDiscountsTransfer, function (CollectedDiscountTransfer $a, CollectedDiscountTransfer $b) { |
|
194 | + usort($collectedDiscountsTransfer, function(CollectedDiscountTransfer $a, CollectedDiscountTransfer $b) { |
|
195 | 195 | $amountA = (int)$a->getDiscount()->getAmount(); |
196 | 196 | $amountB = (int)$b->getDiscount()->getAmount(); |
197 | 197 |
@@ -148,9 +148,9 @@ discard block |
||
148 | 148 | |
149 | 149 | case $this->isValue($token): |
150 | 150 | $value = $this->clearQuotes($token); |
151 | - $clauseTransfer->setValue($value); |
|
151 | + $clauseTransfer->setValue($value); |
|
152 | 152 | |
153 | - $this->clauseValidator->validateClause($clauseTransfer); |
|
153 | + $this->clauseValidator->validateClause($clauseTransfer); |
|
154 | 154 | |
155 | 155 | if ($leftNode === null) { |
156 | 156 | $leftNode = $this->specificationProvider->getSpecificationContext($clauseTransfer); |
@@ -308,8 +308,8 @@ discard block |
||
308 | 308 | */ |
309 | 309 | protected function isValue($token) |
310 | 310 | { |
311 | - $first = substr($token, 0, 1); |
|
312 | - $last = substr($token, -1); |
|
311 | + $first = substr($token, 0, 1); |
|
312 | + $last = substr($token, -1); |
|
313 | 313 | |
314 | 314 | if ($first === '"' && $last === '"') { |
315 | 315 | return true; |
@@ -319,7 +319,7 @@ discard block |
||
319 | 319 | return true; |
320 | 320 | } |
321 | 321 | |
322 | - return false; |
|
322 | + return false; |
|
323 | 323 | } |
324 | 324 | |
325 | 325 | } |
@@ -45,7 +45,7 @@ |
||
45 | 45 | return array_uintersect( |
46 | 46 | $lefCollectedItems, |
47 | 47 | $rightCollectedItems, |
48 | - function (DiscountableItemTransfer $collected, DiscountableItemTransfer $toCollect) { |
|
48 | + function(DiscountableItemTransfer $collected, DiscountableItemTransfer $toCollect) { |
|
49 | 49 | return strcmp(spl_object_hash($collected->getOriginalItemCalculatedDiscounts()), spl_object_hash($toCollect->getOriginalItemCalculatedDiscounts())); |
50 | 50 | } |
51 | 51 | ); |
@@ -14,9 +14,9 @@ discard block |
||
14 | 14 | class DecisionRuleContext implements DecisionRuleSpecificationInterface |
15 | 15 | { |
16 | 16 | |
17 | - /** |
|
18 | - * @var \Spryker\Zed\Discount\Dependency\Plugin\DecisionRulePluginInterface |
|
19 | - */ |
|
17 | + /** |
|
18 | + * @var \Spryker\Zed\Discount\Dependency\Plugin\DecisionRulePluginInterface |
|
19 | + */ |
|
20 | 20 | protected $rulePlugin; |
21 | 21 | |
22 | 22 | /** |
@@ -24,31 +24,31 @@ discard block |
||
24 | 24 | */ |
25 | 25 | protected $clauseTransfer; |
26 | 26 | |
27 | - /** |
|
28 | - * @param \Spryker\Zed\Discount\Dependency\Plugin\DecisionRulePluginInterface $rulePlugin |
|
29 | - * @param \Generated\Shared\Transfer\ClauseTransfer $clauseTransfer |
|
30 | - */ |
|
27 | + /** |
|
28 | + * @param \Spryker\Zed\Discount\Dependency\Plugin\DecisionRulePluginInterface $rulePlugin |
|
29 | + * @param \Generated\Shared\Transfer\ClauseTransfer $clauseTransfer |
|
30 | + */ |
|
31 | 31 | public function __construct(DecisionRulePluginInterface $rulePlugin, ClauseTransfer $clauseTransfer) |
32 | 32 | { |
33 | 33 | $this->rulePlugin = $rulePlugin; |
34 | 34 | $this->clauseTransfer = $clauseTransfer; |
35 | 35 | } |
36 | 36 | |
37 | - /** |
|
38 | - * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer |
|
39 | - * @param \Generated\Shared\Transfer\ItemTransfer $itemTransfer |
|
40 | - * |
|
41 | - * @return bool |
|
42 | - */ |
|
37 | + /** |
|
38 | + * @param \Generated\Shared\Transfer\QuoteTransfer $quoteTransfer |
|
39 | + * @param \Generated\Shared\Transfer\ItemTransfer $itemTransfer |
|
40 | + * |
|
41 | + * @return bool |
|
42 | + */ |
|
43 | 43 | public function isSatisfiedBy(QuoteTransfer $quoteTransfer, ItemTransfer $itemTransfer) |
44 | 44 | { |
45 | 45 | $this->setAcceptedDataTypes(); |
46 | 46 | return $this->rulePlugin->isSatisfiedBy($quoteTransfer, $itemTransfer, $this->clauseTransfer); |
47 | 47 | } |
48 | 48 | |
49 | - /** |
|
50 | - * @return void |
|
51 | - */ |
|
49 | + /** |
|
50 | + * @return void |
|
51 | + */ |
|
52 | 52 | protected function setAcceptedDataTypes() |
53 | 53 | { |
54 | 54 | $this->clauseTransfer->setAcceptedTypes($this->rulePlugin->acceptedDataTypes()); |
@@ -107,7 +107,7 @@ |
||
107 | 107 | |
108 | 108 | $streamedResponse = new StreamedResponse(); |
109 | 109 | |
110 | - $streamedResponse->setCallback(function () use ($generatedVouchers) { |
|
110 | + $streamedResponse->setCallback(function() use ($generatedVouchers) { |
|
111 | 111 | $csvHandle = fopen('php://output', 'w+'); |
112 | 112 | fputcsv($csvHandle, ['Voucher Code']); |
113 | 113 |
@@ -147,7 +147,7 @@ |
||
147 | 147 | */ |
148 | 148 | protected function getStatus(SpyDiscount $discountEntity) |
149 | 149 | { |
150 | - return $discountEntity->getIsActive() ? 'Active' : 'Inactive'; |
|
150 | + return $discountEntity->getIsActive() ? 'Active' : 'Inactive'; |
|
151 | 151 | } |
152 | 152 | |
153 | 153 | /** |
@@ -49,7 +49,7 @@ |
||
49 | 49 | */ |
50 | 50 | public function getAllowedCodeCharactersLength() |
51 | 51 | { |
52 | - $charactersLength = array_reduce($this->getVoucherCodeCharacters(), function ($length, $items) { |
|
52 | + $charactersLength = array_reduce($this->getVoucherCodeCharacters(), function($length, $items) { |
|
53 | 53 | $length += count($items); |
54 | 54 | |
55 | 55 | return $length; |
@@ -38,7 +38,7 @@ |
||
38 | 38 | $this->debugSection('Discount Id', $discountId); |
39 | 39 | |
40 | 40 | $cleanupModule = $this->getDataCleanupHelper(); |
41 | - $cleanupModule->_addCleanup(function () use ($discountId) { |
|
41 | + $cleanupModule->_addCleanup(function() use ($discountId) { |
|
42 | 42 | $this->debug('Deleting Discount: ' . $discountId); |
43 | 43 | $this->getDiscountQuery()->queryDiscount()->findByIdDiscount($discountId)->delete(); |
44 | 44 | }); |