DiscountDependencyProvider   A
last analyzed

Complexity

Total Complexity 15

Size/Duplication

Total Lines 166
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 15
eloc 49
dl 0
loc 166
c 1
b 0
f 0
rs 10

15 Methods

Rating   Name   Duplication   Size   Complexity  
A getDiscountFormDataProviderExpanderPlugins() 0 4 1
A getMoneyCollectionFormTypePlugin() 0 3 1
A getDiscountPostCreatePlugins() 0 4 1
A getDiscountableItemFilterPlugins() 0 4 1
A getDiscountFormExpanderPlugins() 0 4 1
A getStoreRelationFormTypePlugin() 0 3 1
A getDiscountApplicableFilterPlugins() 0 4 1
A getDiscountableItemTransformerStrategyPlugins() 0 4 1
A getDiscountPostUpdatePlugins() 0 6 1
A getCollectorStrategyPlugins() 0 4 1
A getDiscountViewTemplateProviderPlugins() 0 4 1
A getDiscountConfigurationExpanderPlugins() 0 4 1
A getCollectedDiscountGroupingPlugins() 0 4 1
A getCollectorPlugins() 0 11 1
A getDecisionRulePlugins() 0 15 1
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\DiscountPromotionFilterApplicableItemsPlugin;
25
use Spryker\Zed\DiscountPromotion\Communication\Plugin\Discount\DiscountPromotionFilterCollectedItemsPlugin;
26
use Spryker\Zed\DiscountPromotion\Communication\Plugin\Discount\DiscountPromotionPostCreatePlugin;
27
use Spryker\Zed\DiscountPromotion\Communication\Plugin\Discount\DiscountPromotionPostUpdatePlugin;
28
use Spryker\Zed\DiscountPromotion\Communication\Plugin\Discount\DiscountPromotionViewBlockProviderPlugin;
29
use Spryker\Zed\DiscountPromotion\Communication\Plugin\Discount\PromotionCollectedDiscountGroupingStrategyPlugin;
30
use Spryker\Zed\Kernel\Communication\Form\FormTypeInterface;
31
use Spryker\Zed\MerchantDiscountConnector\Communication\Plugin\Discount\MerchantReferenceDecisionRulePlugin;
32
use Spryker\Zed\MerchantDiscountConnector\Communication\Plugin\Discount\MerchantReferenceDiscountableItemCollectorPlugin;
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\ProductOfferDiscountConnector\Communication\Plugin\Discount\ProductOfferReferenceDecisionRulePlugin;
39
use Spryker\Zed\ProductOfferDiscountConnector\Communication\Plugin\Discount\ProductOfferReferenceDiscountableItemCollectorPlugin;
40
use Spryker\Zed\SalesDiscountConnector\Communication\Plugin\Discount\CustomerOrderCountDecisionRulePlugin;
41
use Spryker\Zed\SalesQuantity\Communication\Plugin\DiscountExtension\NonSplittableDiscountableItemTransformerStrategyPlugin;
42
use Spryker\Zed\ShipmentDiscountConnector\Communication\Plugin\DecisionRule\ShipmentCarrierDecisionRulePlugin;
43
use Spryker\Zed\ShipmentDiscountConnector\Communication\Plugin\DecisionRule\ShipmentMethodDecisionRulePlugin;
44
use Spryker\Zed\ShipmentDiscountConnector\Communication\Plugin\DecisionRule\ShipmentPriceDecisionRulePlugin;
45
use Spryker\Zed\ShipmentDiscountConnector\Communication\Plugin\DiscountCollector\ItemByShipmentCarrierPlugin;
46
use Spryker\Zed\ShipmentDiscountConnector\Communication\Plugin\DiscountCollector\ItemByShipmentMethodPlugin;
47
use Spryker\Zed\ShipmentDiscountConnector\Communication\Plugin\DiscountCollector\ItemByShipmentPricePlugin;
48
use Spryker\Zed\Store\Communication\Plugin\Form\StoreRelationToggleFormTypePlugin;
49
50
class DiscountDependencyProvider extends SprykerDiscountDependencyProvider
51
{
52
    /**
53
     * @return array<\Spryker\Zed\DiscountExtension\Dependency\Plugin\DecisionRulePluginInterface>
54
     */
55
    protected function getDecisionRulePlugins(): array
56
    {
57
        return array_merge(parent::getDecisionRulePlugins(), [
58
            new ShipmentCarrierDecisionRulePlugin(),
59
            new ShipmentMethodDecisionRulePlugin(),
60
            new ShipmentPriceDecisionRulePlugin(),
61
            new CustomerGroupDecisionRulePlugin(),
62
            new ProductLabelListDecisionRulePlugin(),
63
            new ProductAttributeDecisionRulePlugin(),
64
            new CategoryDecisionRulePlugin(),
65
            new CustomerOrderCountDecisionRulePlugin(),
66
            new ProductOfferReferenceDecisionRulePlugin(),
67
            new MerchantReferenceDecisionRulePlugin(),
68
            new CustomerReferenceDecisionRulePlugin(),
69
            new CustomerMaximumOrderAmountDecisionRulePlugin(),
70
        ]);
71
    }
72
73
    /**
74
     * @return array<\Spryker\Zed\DiscountExtension\Dependency\Plugin\DiscountableItemCollectorPluginInterface>
75
     */
76
    protected function getCollectorPlugins(): array
77
    {
78
        return array_merge(parent::getCollectorPlugins(), [
79
            new ProductLabelDiscountableItemCollectorPlugin(),
80
            new ItemByShipmentCarrierPlugin(),
81
            new ItemByShipmentMethodPlugin(),
82
            new ItemByShipmentPricePlugin(),
83
            new ProductAttributeCollectorPlugin(),
84
            new CategoryDiscountableItemCollectorPlugin(),
85
            new ProductOfferReferenceDiscountableItemCollectorPlugin(),
86
            new MerchantReferenceDiscountableItemCollectorPlugin(),
87
        ]);
88
    }
89
90
    /**
91
     * @return array<\Spryker\Zed\Discount\Dependency\Plugin\DiscountableItemFilterPluginInterface>
92
     */
93
    protected function getDiscountableItemFilterPlugins(): array
94
    {
95
        return [
96
            new DiscountPromotionFilterCollectedItemsPlugin(),
97
        ];
98
    }
99
100
    /**
101
     * @return array<\Spryker\Zed\DiscountExtension\Dependency\Plugin\CollectedDiscountGroupingStrategyPluginInterface>
102
     */
103
    protected function getCollectedDiscountGroupingPlugins(): array
104
    {
105
        return [
106
            new PromotionCollectedDiscountGroupingStrategyPlugin(),
107
        ];
108
    }
109
110
    /**
111
     * @return array<\Spryker\Zed\DiscountExtension\Dependency\Plugin\DiscountableItemTransformerStrategyPluginInterface>
112
     */
113
    protected function getDiscountableItemTransformerStrategyPlugins(): array
114
    {
115
        return [
116
            new NonSplittableDiscountableItemTransformerStrategyPlugin(),
117
        ];
118
    }
119
120
    /**
121
     * @return array<\Spryker\Zed\Discount\Dependency\Plugin\CollectorStrategyPluginInterface>
122
     */
123
    protected function getCollectorStrategyPlugins(): array
124
    {
125
        return [
126
            new DiscountPromotionCollectorStrategyPlugin(),
127
        ];
128
    }
129
130
    /**
131
     * @return array<\Spryker\Zed\Discount\Dependency\Plugin\DiscountPostCreatePluginInterface>
132
     */
133
    protected function getDiscountPostCreatePlugins(): array
134
    {
135
        return [
136
            new DiscountPromotionPostCreatePlugin(),
137
        ];
138
    }
139
140
    /**
141
     * @return array<\Spryker\Zed\Discount\Dependency\Plugin\DiscountPostUpdatePluginInterface>
142
     */
143
    protected function getDiscountPostUpdatePlugins(): array
144
    {
145
        return [
146
            new DiscountPromotionPostUpdatePlugin(),
0 ignored issues
show
Deprecated Code introduced by
The class Spryker\Zed\DiscountProm...omotionPostUpdatePlugin has been deprecated: Use {@link \Spryker\Zed\DiscountPromotion\Communication\Plugin\Discount\DiscountPromotionDiscountPostUpdatePlugin} instead. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

146
            /** @scrutinizer ignore-deprecated */ new DiscountPromotionPostUpdatePlugin(),
Loading history...
147
            new DiscountPromotionCleanerPostUpdatePlugin(),
148
            new DeleteDiscountVoucherPoolDiscountPostUpdatePlugin(),
149
        ];
150
    }
151
152
    /**
153
     * @return array<\Spryker\Zed\Discount\Dependency\Plugin\DiscountConfigurationExpanderPluginInterface>
154
     */
155
    protected function getDiscountConfigurationExpanderPlugins(): array
156
    {
157
        return [
158
            new DiscountPromotionConfigurationExpanderPlugin(),
159
        ];
160
    }
161
162
    /**
163
     * @return array<\Spryker\Zed\Discount\Dependency\Plugin\Form\DiscountFormExpanderPluginInterface>
164
     */
165
    protected function getDiscountFormExpanderPlugins(): array
166
    {
167
        return [
168
            new DiscountPromotionCalculationFormExpanderPlugin(),
169
        ];
170
    }
171
172
    /**
173
     * @return array<\Spryker\Zed\Discount\Dependency\Plugin\Form\DiscountFormDataProviderExpanderPluginInterface>
174
     */
175
    protected function getDiscountFormDataProviderExpanderPlugins(): array
176
    {
177
        return [
178
            new DiscountPromotionCalculationFormDataExpanderPlugin(),
179
        ];
180
    }
181
182
    /**
183
     * @return array<\Spryker\Zed\Discount\Dependency\Plugin\DiscountViewBlockProviderPluginInterface>
184
     */
185
    protected function getDiscountViewTemplateProviderPlugins(): array
186
    {
187
        return [
188
            new DiscountPromotionViewBlockProviderPlugin(),
189
        ];
190
    }
191
192
    /**
193
     * @return array<\Spryker\Zed\Discount\Dependency\Plugin\DiscountApplicableFilterPluginInterface>
194
     */
195
    protected function getDiscountApplicableFilterPlugins(): array
196
    {
197
        return [
198
           new DiscountPromotionFilterApplicableItemsPlugin(),
199
        ];
200
    }
201
202
    /**
203
     * @return \Spryker\Zed\Kernel\Communication\Form\FormTypeInterface
204
     */
205
    protected function getStoreRelationFormTypePlugin(): FormTypeInterface
206
    {
207
        return new StoreRelationToggleFormTypePlugin();
208
    }
209
210
    /**
211
     * @return \Spryker\Zed\Kernel\Communication\Form\FormTypeInterface
212
     */
213
    protected function getMoneyCollectionFormTypePlugin(): FormTypeInterface
214
    {
215
        return new MoneyCollectionFormTypePlugin();
216
    }
217
}
218