getDecisionRulePlugins()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 11
c 1
b 0
f 0
dl 0
loc 13
rs 9.9
cc 1
nc 1
nop 0
1
<?php
2
3
/**
4
 * This file is part of the Spryker Commerce OS.
5
 * For full license information, please view the LICENSE file that was distributed with this source code.
6
 */
7
8
declare(strict_types = 1);
9
10
namespace Pyz\Zed\Discount;
11
12
use Spryker\Zed\CategoryDiscountConnector\Communication\Plugin\Discount\CategoryDecisionRulePlugin;
13
use Spryker\Zed\CategoryDiscountConnector\Communication\Plugin\Discount\CategoryDiscountableItemCollectorPlugin;
14
use Spryker\Zed\CustomerDiscountConnector\Communication\Plugin\Discount\CustomerMaximumOrderAmountDecisionRulePlugin;
15
use Spryker\Zed\CustomerDiscountConnector\Communication\Plugin\Discount\CustomerReferenceDecisionRulePlugin;
16
use Spryker\Zed\CustomerGroupDiscountConnector\Communication\Plugin\DecisionRule\CustomerGroupDecisionRulePlugin;
17
use Spryker\Zed\Discount\Communication\Plugin\Discount\DeleteDiscountVoucherPoolDiscountPostUpdatePlugin;
18
use Spryker\Zed\Discount\DiscountDependencyProvider as SprykerDiscountDependencyProvider;
19
use Spryker\Zed\DiscountPromotion\Communication\Plugin\Discount\DiscountPromotionCalculationFormDataExpanderPlugin;
20
use Spryker\Zed\DiscountPromotion\Communication\Plugin\Discount\DiscountPromotionCalculationFormExpanderPlugin;
21
use Spryker\Zed\DiscountPromotion\Communication\Plugin\Discount\DiscountPromotionCleanerPostUpdatePlugin;
22
use Spryker\Zed\DiscountPromotion\Communication\Plugin\Discount\DiscountPromotionCollectorStrategyPlugin;
23
use Spryker\Zed\DiscountPromotion\Communication\Plugin\Discount\DiscountPromotionConfigurationExpanderPlugin;
24
use Spryker\Zed\DiscountPromotion\Communication\Plugin\Discount\DiscountPromotionDiscountPostUpdatePlugin;
25
use Spryker\Zed\DiscountPromotion\Communication\Plugin\Discount\DiscountPromotionDiscountVoucherApplyCheckerStrategyPlugin;
26
use Spryker\Zed\DiscountPromotion\Communication\Plugin\Discount\DiscountPromotionFilterApplicableItemsPlugin;
27
use Spryker\Zed\DiscountPromotion\Communication\Plugin\Discount\DiscountPromotionFilterCollectedItemsPlugin;
28
use Spryker\Zed\DiscountPromotion\Communication\Plugin\Discount\DiscountPromotionPostCreatePlugin;
29
use Spryker\Zed\DiscountPromotion\Communication\Plugin\Discount\DiscountPromotionViewBlockProviderPlugin;
30
use Spryker\Zed\DiscountPromotion\Communication\Plugin\Discount\PromotionCollectedDiscountGroupingStrategyPlugin;
31
use Spryker\Zed\GiftCard\Communication\Plugin\GiftCardDiscountableItemFilterPlugin;
32
use Spryker\Zed\Kernel\Communication\Form\FormTypeInterface;
33
use Spryker\Zed\MoneyGui\Communication\Plugin\Form\MoneyCollectionFormTypePlugin;
34
use Spryker\Zed\ProductDiscountConnector\Communication\Plugin\Collector\ProductAttributeCollectorPlugin;
35
use Spryker\Zed\ProductDiscountConnector\Communication\Plugin\DecisionRule\ProductAttributeDecisionRulePlugin;
36
use Spryker\Zed\ProductLabelDiscountConnector\Communication\Plugin\Discount\ProductLabelDiscountableItemCollectorPlugin;
37
use Spryker\Zed\ProductLabelDiscountConnector\Communication\Plugin\Discount\ProductLabelListDecisionRulePlugin;
38
use Spryker\Zed\SalesDiscountConnector\Communication\Plugin\Discount\CustomerOrderCountDecisionRulePlugin;
39
use Spryker\Zed\SalesQuantity\Communication\Plugin\DiscountExtension\NonSplittableDiscountableItemTransformerStrategyPlugin;
40
use Spryker\Zed\ShipmentDiscountConnector\Communication\Plugin\DecisionRule\ShipmentCarrierDecisionRulePlugin;
41
use Spryker\Zed\ShipmentDiscountConnector\Communication\Plugin\DecisionRule\ShipmentMethodDecisionRulePlugin;
42
use Spryker\Zed\ShipmentDiscountConnector\Communication\Plugin\DecisionRule\ShipmentPriceDecisionRulePlugin;
43
use Spryker\Zed\ShipmentDiscountConnector\Communication\Plugin\DiscountCollector\ItemByShipmentCarrierPlugin;
44
use Spryker\Zed\ShipmentDiscountConnector\Communication\Plugin\DiscountCollector\ItemByShipmentMethodPlugin;
45
use Spryker\Zed\ShipmentDiscountConnector\Communication\Plugin\DiscountCollector\ItemByShipmentPricePlugin;
46
use Spryker\Zed\Store\Communication\Plugin\Form\StoreRelationToggleFormTypePlugin;
47
48
class DiscountDependencyProvider extends SprykerDiscountDependencyProvider
49
{
50
    /**
51
     * @return array<\Spryker\Zed\DiscountExtension\Dependency\Plugin\DecisionRulePluginInterface>
52
     */
53
    protected function getDecisionRulePlugins(): array
54
    {
55
        return array_merge(parent::getDecisionRulePlugins(), [
56
            new ShipmentCarrierDecisionRulePlugin(),
57
            new ShipmentMethodDecisionRulePlugin(),
58
            new ShipmentPriceDecisionRulePlugin(),
59
            new CustomerGroupDecisionRulePlugin(),
60
            new ProductLabelListDecisionRulePlugin(),
61
            new ProductAttributeDecisionRulePlugin(),
62
            new CategoryDecisionRulePlugin(),
63
            new CustomerOrderCountDecisionRulePlugin(),
64
            new CustomerReferenceDecisionRulePlugin(),
65
            new CustomerMaximumOrderAmountDecisionRulePlugin(),
66
        ]);
67
    }
68
69
    /**
70
     * @return array<\Spryker\Zed\DiscountExtension\Dependency\Plugin\DiscountableItemCollectorPluginInterface>
71
     */
72
    protected function getCollectorPlugins(): array
73
    {
74
        return array_merge(parent::getCollectorPlugins(), [
75
            new ProductLabelDiscountableItemCollectorPlugin(),
76
            new ItemByShipmentCarrierPlugin(),
77
            new ItemByShipmentMethodPlugin(),
78
            new ItemByShipmentPricePlugin(),
79
            new ProductAttributeCollectorPlugin(),
80
            new CategoryDiscountableItemCollectorPlugin(),
81
        ]);
82
    }
83
84
    /**
85
     * @return array<\Spryker\Zed\Discount\Dependency\Plugin\DiscountableItemFilterPluginInterface>
86
     */
87
    protected function getDiscountableItemFilterPlugins(): array
88
    {
89
        return [
90
            new DiscountPromotionFilterCollectedItemsPlugin(),
91
            new GiftCardDiscountableItemFilterPlugin(), #GiftCardFeature
92
        ];
93
    }
94
95
    /**
96
     * @return array<\Spryker\Zed\DiscountExtension\Dependency\Plugin\CollectedDiscountGroupingStrategyPluginInterface>
97
     */
98
    protected function getCollectedDiscountGroupingPlugins(): array
99
    {
100
        return [
101
            new PromotionCollectedDiscountGroupingStrategyPlugin(),
102
        ];
103
    }
104
105
    /**
106
     * @return array<\Spryker\Zed\DiscountExtension\Dependency\Plugin\DiscountableItemTransformerStrategyPluginInterface>
107
     */
108
    protected function getDiscountableItemTransformerStrategyPlugins(): array
109
    {
110
        return [
111
            new NonSplittableDiscountableItemTransformerStrategyPlugin(),
112
        ];
113
    }
114
115
    /**
116
     * @return array<\Spryker\Zed\Discount\Dependency\Plugin\CollectorStrategyPluginInterface>
117
     */
118
    protected function getCollectorStrategyPlugins(): array
119
    {
120
        return [
121
            new DiscountPromotionCollectorStrategyPlugin(),
122
        ];
123
    }
124
125
    /**
126
     * @return array<\Spryker\Zed\Discount\Dependency\Plugin\DiscountPostCreatePluginInterface>
127
     */
128
    protected function getDiscountPostCreatePlugins(): array
129
    {
130
        return [
131
            new DiscountPromotionPostCreatePlugin(),
132
        ];
133
    }
134
135
    /**
136
     * @return array<\Spryker\Zed\Discount\Dependency\Plugin\DiscountPostUpdatePluginInterface>
137
     */
138
    protected function getDiscountPostUpdatePlugins(): array
139
    {
140
        return [
141
            new DiscountPromotionDiscountPostUpdatePlugin(),
142
            new DiscountPromotionCleanerPostUpdatePlugin(),
143
            new DeleteDiscountVoucherPoolDiscountPostUpdatePlugin(),
144
        ];
145
    }
146
147
    /**
148
     * @return array<\Spryker\Zed\Discount\Dependency\Plugin\DiscountConfigurationExpanderPluginInterface>
149
     */
150
    protected function getDiscountConfigurationExpanderPlugins(): array
151
    {
152
        return [
153
            new DiscountPromotionConfigurationExpanderPlugin(),
154
        ];
155
    }
156
157
    /**
158
     * @return array<\Spryker\Zed\Discount\Dependency\Plugin\Form\DiscountFormExpanderPluginInterface>
159
     */
160
    protected function getDiscountFormExpanderPlugins(): array
161
    {
162
        return [
163
            new DiscountPromotionCalculationFormExpanderPlugin(),
164
        ];
165
    }
166
167
    /**
168
     * @return array<\Spryker\Zed\Discount\Dependency\Plugin\Form\DiscountFormDataProviderExpanderPluginInterface>
169
     */
170
    protected function getDiscountFormDataProviderExpanderPlugins(): array
171
    {
172
        return [
173
            new DiscountPromotionCalculationFormDataExpanderPlugin(),
174
        ];
175
    }
176
177
    /**
178
     * @return array<\Spryker\Zed\Discount\Dependency\Plugin\DiscountViewBlockProviderPluginInterface>
179
     */
180
    protected function getDiscountViewTemplateProviderPlugins(): array
181
    {
182
        return [
183
            new DiscountPromotionViewBlockProviderPlugin(),
184
        ];
185
    }
186
187
    /**
188
     * @return array<\Spryker\Zed\Discount\Dependency\Plugin\DiscountApplicableFilterPluginInterface>
189
     */
190
    protected function getDiscountApplicableFilterPlugins(): array
191
    {
192
        return [
193
           new DiscountPromotionFilterApplicableItemsPlugin(),
194
        ];
195
    }
196
197
    /**
198
     * @return \Spryker\Zed\Kernel\Communication\Form\FormTypeInterface
199
     */
200
    protected function getStoreRelationFormTypePlugin(): FormTypeInterface
201
    {
202
        return new StoreRelationToggleFormTypePlugin();
203
    }
204
205
    /**
206
     * @return array<\Spryker\Zed\DiscountExtension\Dependency\Plugin\DiscountVoucherApplyCheckerStrategyPluginInterface>
207
     */
208
    protected function getDiscountVoucherApplyCheckerStrategyPlugins(): array
209
    {
210
        return [
211
            new DiscountPromotionDiscountVoucherApplyCheckerStrategyPlugin(),
212
        ];
213
    }
214
215
    /**
216
     * @return \Spryker\Zed\Kernel\Communication\Form\FormTypeInterface
217
     */
218
    protected function getMoneyCollectionFormTypePlugin(): FormTypeInterface
219
    {
220
        return new MoneyCollectionFormTypePlugin();
221
    }
222
}
223