DiscountDependencyProvider::getCollectorPlugins()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 9
rs 10
c 0
b 0
f 0
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\Kernel\Communication\Form\FormTypeInterface;
32
use Spryker\Zed\MoneyGui\Communication\Plugin\Form\MoneyCollectionFormTypePlugin;
33
use Spryker\Zed\ProductDiscountConnector\Communication\Plugin\Collector\ProductAttributeCollectorPlugin;
34
use Spryker\Zed\ProductDiscountConnector\Communication\Plugin\DecisionRule\ProductAttributeDecisionRulePlugin;
35
use Spryker\Zed\ProductLabelDiscountConnector\Communication\Plugin\Discount\ProductLabelDiscountableItemCollectorPlugin;
36
use Spryker\Zed\ProductLabelDiscountConnector\Communication\Plugin\Discount\ProductLabelListDecisionRulePlugin;
37
use Spryker\Zed\SalesDiscountConnector\Communication\Plugin\Discount\CustomerOrderCountDecisionRulePlugin;
38
use Spryker\Zed\SalesQuantity\Communication\Plugin\DiscountExtension\NonSplittableDiscountableItemTransformerStrategyPlugin;
39
use Spryker\Zed\ShipmentDiscountConnector\Communication\Plugin\DecisionRule\ShipmentCarrierDecisionRulePlugin;
40
use Spryker\Zed\ShipmentDiscountConnector\Communication\Plugin\DecisionRule\ShipmentMethodDecisionRulePlugin;
41
use Spryker\Zed\ShipmentDiscountConnector\Communication\Plugin\DecisionRule\ShipmentPriceDecisionRulePlugin;
42
use Spryker\Zed\ShipmentDiscountConnector\Communication\Plugin\DiscountCollector\ItemByShipmentCarrierPlugin;
43
use Spryker\Zed\ShipmentDiscountConnector\Communication\Plugin\DiscountCollector\ItemByShipmentMethodPlugin;
44
use Spryker\Zed\ShipmentDiscountConnector\Communication\Plugin\DiscountCollector\ItemByShipmentPricePlugin;
45
use Spryker\Zed\Store\Communication\Plugin\Form\StoreRelationToggleFormTypePlugin;
46
47
class DiscountDependencyProvider extends SprykerDiscountDependencyProvider
48
{
49
    /**
50
     * @return array<\Spryker\Zed\DiscountExtension\Dependency\Plugin\DecisionRulePluginInterface>
51
     */
52
    protected function getDecisionRulePlugins(): array
53
    {
54
        return array_merge(parent::getDecisionRulePlugins(), [
55
            new ShipmentCarrierDecisionRulePlugin(),
56
            new ShipmentMethodDecisionRulePlugin(),
57
            new ShipmentPriceDecisionRulePlugin(),
58
            new CustomerGroupDecisionRulePlugin(),
59
            new ProductLabelListDecisionRulePlugin(),
60
            new ProductAttributeDecisionRulePlugin(),
61
            new CategoryDecisionRulePlugin(),
62
            new CustomerOrderCountDecisionRulePlugin(),
63
            new CustomerReferenceDecisionRulePlugin(),
64
            new CustomerMaximumOrderAmountDecisionRulePlugin(),
65
        ]);
66
    }
67
68
    /**
69
     * @return array<\Spryker\Zed\DiscountExtension\Dependency\Plugin\DiscountableItemCollectorPluginInterface>
70
     */
71
    protected function getCollectorPlugins(): array
72
    {
73
        return array_merge(parent::getCollectorPlugins(), [
74
            new ProductLabelDiscountableItemCollectorPlugin(),
75
            new ItemByShipmentCarrierPlugin(),
76
            new ItemByShipmentMethodPlugin(),
77
            new ItemByShipmentPricePlugin(),
78
            new ProductAttributeCollectorPlugin(),
79
            new CategoryDiscountableItemCollectorPlugin(),
80
        ]);
81
    }
82
83
    /**
84
     * @return array<\Spryker\Zed\Discount\Dependency\Plugin\DiscountableItemFilterPluginInterface>
85
     */
86
    protected function getDiscountableItemFilterPlugins(): array
87
    {
88
        return [
89
            new DiscountPromotionFilterCollectedItemsPlugin(),
90
        ];
91
    }
92
93
    /**
94
     * @return array<\Spryker\Zed\DiscountExtension\Dependency\Plugin\CollectedDiscountGroupingStrategyPluginInterface>
95
     */
96
    protected function getCollectedDiscountGroupingPlugins(): array
97
    {
98
        return [
99
            new PromotionCollectedDiscountGroupingStrategyPlugin(),
100
        ];
101
    }
102
103
    /**
104
     * @return array<\Spryker\Zed\DiscountExtension\Dependency\Plugin\DiscountableItemTransformerStrategyPluginInterface>
105
     */
106
    protected function getDiscountableItemTransformerStrategyPlugins(): array
107
    {
108
        return [
109
            new NonSplittableDiscountableItemTransformerStrategyPlugin(),
110
        ];
111
    }
112
113
    /**
114
     * @return array<\Spryker\Zed\Discount\Dependency\Plugin\CollectorStrategyPluginInterface>
115
     */
116
    protected function getCollectorStrategyPlugins(): array
117
    {
118
        return [
119
            new DiscountPromotionCollectorStrategyPlugin(),
120
        ];
121
    }
122
123
    /**
124
     * @return array<\Spryker\Zed\Discount\Dependency\Plugin\DiscountPostCreatePluginInterface>
125
     */
126
    protected function getDiscountPostCreatePlugins(): array
127
    {
128
        return [
129
            new DiscountPromotionPostCreatePlugin(),
130
        ];
131
    }
132
133
    /**
134
     * @return array<\Spryker\Zed\Discount\Dependency\Plugin\DiscountPostUpdatePluginInterface>
135
     */
136
    protected function getDiscountPostUpdatePlugins(): array
137
    {
138
        return [
139
            new DiscountPromotionDiscountPostUpdatePlugin(),
140
            new DiscountPromotionCleanerPostUpdatePlugin(),
141
            new DeleteDiscountVoucherPoolDiscountPostUpdatePlugin(),
142
        ];
143
    }
144
145
    /**
146
     * @return array<\Spryker\Zed\Discount\Dependency\Plugin\DiscountConfigurationExpanderPluginInterface>
147
     */
148
    protected function getDiscountConfigurationExpanderPlugins(): array
149
    {
150
        return [
151
            new DiscountPromotionConfigurationExpanderPlugin(),
152
        ];
153
    }
154
155
    /**
156
     * @return array<\Spryker\Zed\Discount\Dependency\Plugin\Form\DiscountFormExpanderPluginInterface>
157
     */
158
    protected function getDiscountFormExpanderPlugins(): array
159
    {
160
        return [
161
            new DiscountPromotionCalculationFormExpanderPlugin(),
162
        ];
163
    }
164
165
    /**
166
     * @return array<\Spryker\Zed\Discount\Dependency\Plugin\Form\DiscountFormDataProviderExpanderPluginInterface>
167
     */
168
    protected function getDiscountFormDataProviderExpanderPlugins(): array
169
    {
170
        return [
171
            new DiscountPromotionCalculationFormDataExpanderPlugin(),
172
        ];
173
    }
174
175
    /**
176
     * @return array<\Spryker\Zed\Discount\Dependency\Plugin\DiscountViewBlockProviderPluginInterface>
177
     */
178
    protected function getDiscountViewTemplateProviderPlugins(): array
179
    {
180
        return [
181
            new DiscountPromotionViewBlockProviderPlugin(),
182
        ];
183
    }
184
185
    /**
186
     * @return array<\Spryker\Zed\Discount\Dependency\Plugin\DiscountApplicableFilterPluginInterface>
187
     */
188
    protected function getDiscountApplicableFilterPlugins(): array
189
    {
190
        return [
191
           new DiscountPromotionFilterApplicableItemsPlugin(),
192
        ];
193
    }
194
195
    protected function getStoreRelationFormTypePlugin(): FormTypeInterface
196
    {
197
        return new StoreRelationToggleFormTypePlugin();
198
    }
199
200
    protected function getMoneyCollectionFormTypePlugin(): FormTypeInterface
201
    {
202
        return new MoneyCollectionFormTypePlugin();
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