Passed
Pull Request — master (#608)
by Damir
05:59
created

getSalesOrderItemCollectionPreDeletePlugins()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 13
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 11
dl 0
loc 13
rs 9.9
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\Sales;
11
12
use Spryker\Zed\Currency\Communication\Plugin\Sales\CurrencyOrderExpanderPlugin;
13
use Spryker\Zed\Customer\Communication\Plugin\Sales\CustomerOrderHydratePlugin;
14
use Spryker\Zed\Discount\Communication\Plugin\Sales\DiscountOrderHydratePlugin;
15
use Spryker\Zed\Discount\Communication\Plugin\Sales\DiscountSalesOrderItemCollectionPreDeletePlugin;
16
use Spryker\Zed\Discount\Communication\Plugin\Sales\SalesDiscountSalesExpensePreDeletePlugin;
17
use Spryker\Zed\GiftCard\Communication\Plugin\Sales\GiftCardOrderItemsPostSavePlugin;
18
use Spryker\Zed\GiftCard\Communication\Plugin\Sales\GiftCardSalesOrderItemCollectionPreDeletePlugin;
19
use Spryker\Zed\MerchantOmsGui\Communication\Plugin\Sales\MerchantOmsStateOrderItemsTableExpanderPlugin;
20
use Spryker\Zed\MerchantProfile\Communication\Plugin\Sales\MerchantDataOrderHydratePlugin;
21
use Spryker\Zed\MerchantSalesOrder\Communication\Plugin\Sales\MerchantOrderDataOrderExpanderPlugin;
22
use Spryker\Zed\MerchantSalesOrder\Communication\Plugin\Sales\MerchantReferenceOrderItemExpanderPreSavePlugin;
23
use Spryker\Zed\MerchantSalesOrder\Communication\Plugin\Sales\MerchantReferencesOrderExpanderPlugin;
24
use Spryker\Zed\Nopayment\Communication\Plugin\Sales\NopaymentSalesOrderItemCollectionPreDeletePlugin;
25
use Spryker\Zed\Oms\Communication\Plugin\Sales\DefaultOrderItemInitialStateProviderPlugin;
26
use Spryker\Zed\Oms\Communication\Plugin\Sales\IsCancellableOrderExpanderPlugin;
27
use Spryker\Zed\Oms\Communication\Plugin\Sales\IsCancellableSearchOrderExpanderPlugin;
28
use Spryker\Zed\Oms\Communication\Plugin\Sales\ItemStateOrderItemExpanderPlugin;
29
use Spryker\Zed\Oms\Communication\Plugin\Sales\OmsItemHistorySalesOrderItemCollectionPreDeletePlugin;
30
use Spryker\Zed\Oms\Communication\Plugin\Sales\OmsStatesOrderExpanderPlugin;
31
use Spryker\Zed\Oms\Communication\Plugin\Sales\OrderAggregatedItemStateSearchOrderExpanderPlugin;
32
use Spryker\Zed\Oms\Communication\Plugin\Sales\StateHistoryOrderItemExpanderPlugin;
33
use Spryker\Zed\OmsMultiThread\Communication\Plugin\Sales\OmsMultiThreadProcessorIdentifierOrderExpanderPreSavePlugin;
34
use Spryker\Zed\OrderCustomReference\Communication\Plugin\Sales\OrderCustomReferenceOrderPostSavePlugin;
35
use Spryker\Zed\OrderCustomReference\Communication\Plugin\Sales\UpdateOrderCustomReferenceOrderPostSavePlugin;
36
use Spryker\Zed\ProductBundle\Communication\Plugin\Sales\ProductBundleIdHydratorPlugin;
37
use Spryker\Zed\ProductBundle\Communication\Plugin\Sales\ProductBundleOptionItemExpanderPlugin;
38
use Spryker\Zed\ProductBundle\Communication\Plugin\Sales\ProductBundleOptionOrderExpanderPlugin;
39
use Spryker\Zed\ProductBundle\Communication\Plugin\Sales\ProductBundleOrderHydratePlugin;
40
use Spryker\Zed\ProductBundle\Communication\Plugin\Sales\ProductBundleOrderItemExpanderPlugin;
41
use Spryker\Zed\ProductBundle\Communication\Plugin\Sales\UniqueOrderBundleItemsExpanderPlugin;
42
use Spryker\Zed\ProductOfferSales\Communication\Plugin\Sales\ProductOfferReferenceOrderItemExpanderPreSavePlugin;
43
use Spryker\Zed\ProductOption\Communication\Plugin\Sales\ProductOptionGroupIdHydratorPlugin;
44
use Spryker\Zed\ProductOption\Communication\Plugin\Sales\ProductOptionOrderItemsPostSavePlugin;
45
use Spryker\Zed\ProductOption\Communication\Plugin\Sales\ProductOptionSalesOrderItemCollectionPostUpdatePlugin;
46
use Spryker\Zed\ProductOption\Communication\Plugin\Sales\ProductOptionSalesOrderItemCollectionPreDeletePlugin;
47
use Spryker\Zed\ProductOption\Communication\Plugin\Sales\ProductOptionsOrderItemExpanderPlugin;
48
use Spryker\Zed\Sales\Communication\Plugin\Sales\CurrencyIsoCodeOrderItemExpanderPlugin;
49
use Spryker\Zed\Sales\SalesDependencyProvider as SprykerSalesDependencyProvider;
50
use Spryker\Zed\SalesConfigurableBundle\Communication\Plugin\Sales\ConfiguredBundleItemPreTransformerPlugin;
51
use Spryker\Zed\SalesConfigurableBundle\Communication\Plugin\Sales\ConfiguredBundleOrderItemExpanderPlugin;
52
use Spryker\Zed\SalesConfigurableBundle\Communication\Plugin\Sales\ConfiguredBundlesOrderItemsPostSavePlugin;
53
use Spryker\Zed\SalesConfigurableBundle\Communication\Plugin\Sales\SalesConfigurableBundleSalesOrderItemCollectionPreDeletePlugin;
54
use Spryker\Zed\SalesConfigurableBundle\Communication\Plugin\Sales\SalesConfiguredBundlesSalesOrderItemCollectionPostUpdatePlugin;
55
use Spryker\Zed\SalesMerchantCommission\Communication\Plugin\Sales\MerchantCommissionOrderPostCancelPlugin;
56
use Spryker\Zed\SalesOms\Communication\Plugin\OrderItemReferenceExpanderPreSavePlugin;
57
use Spryker\Zed\SalesOrderAmendment\Communication\Plugin\Sales\CreateSalesOrderAmendmentOrderPostSavePlugin;
58
use Spryker\Zed\SalesOrderAmendment\Communication\Plugin\Sales\SalesOrderAmendmentOrderExpanderPlugin;
59
use Spryker\Zed\SalesOrderAmendmentOms\Communication\Plugin\Sales\IsAmendableOrderExpanderPlugin;
60
use Spryker\Zed\SalesOrderAmendmentOms\Communication\Plugin\Sales\IsAmendableOrderSearchOrderExpanderPlugin;
61
use Spryker\Zed\SalesOrderAmendmentOms\Communication\Plugin\Sales\OrderAmendmentDefaultOrderItemInitialStateProviderPlugin;
62
use Spryker\Zed\SalesPayment\Communication\Plugin\Sales\SalesPaymentOrderExpanderPlugin;
63
use Spryker\Zed\SalesProductConfiguration\Communication\Plugin\Sales\ProductConfigurationOrderItemExpanderPlugin;
64
use Spryker\Zed\SalesProductConfiguration\Communication\Plugin\Sales\ProductConfigurationOrderItemsPostSavePlugin;
65
use Spryker\Zed\SalesProductConfiguration\Communication\Plugin\Sales\SalesProductConfigurationSalesOrderItemCollectionPostUpdatePlugin;
66
use Spryker\Zed\SalesProductConfiguration\Communication\Plugin\Sales\SalesProductConfigurationSalesOrderItemCollectionPreDeletePlugin;
67
use Spryker\Zed\SalesProductConnector\Communication\Plugin\Sales\ItemMetadataOrderItemsPostSavePlugin;
68
use Spryker\Zed\SalesProductConnector\Communication\Plugin\Sales\ItemMetadataSalesOrderItemCollectionPostUpdatePlugin;
69
use Spryker\Zed\SalesProductConnector\Communication\Plugin\Sales\ItemMetadataSalesOrderItemCollectionPreDeletePlugin;
70
use Spryker\Zed\SalesProductConnector\Communication\Plugin\Sales\ItemMetadataSearchOrderExpanderPlugin;
71
use Spryker\Zed\SalesProductConnector\Communication\Plugin\Sales\MetadataOrderItemExpanderPlugin;
72
use Spryker\Zed\SalesProductConnector\Communication\Plugin\Sales\ProductIdOrderItemExpanderPlugin;
73
use Spryker\Zed\SalesQuantity\Communication\Plugin\SalesExtension\IsQuantitySplittableOrderItemExpanderPreSavePlugin;
74
use Spryker\Zed\SalesQuantity\Communication\Plugin\SalesExtension\NonSplittableItemTransformerStrategyPlugin;
75
use Spryker\Zed\SalesReclamation\Communication\Plugin\Sales\SalesReclamationSalesOrderItemCollectionPreDeletePlugin;
76
use Spryker\Zed\SalesReclamationGui\Communication\Plugin\Sales\ReclamationSalesTablePlugin;
77
use Spryker\Zed\SalesReturn\Communication\Plugin\Sales\RemunerationTotalOrderExpanderPlugin;
78
use Spryker\Zed\SalesReturn\Communication\Plugin\Sales\UpdateOrderItemIsReturnableByGlobalReturnableNumberOfDaysPlugin;
79
use Spryker\Zed\SalesReturn\Communication\Plugin\Sales\UpdateOrderItemIsReturnableByItemStatePlugin;
80
use Spryker\Zed\SalesServicePoint\Communication\Plugin\Sales\ServicePointOrderItemExpanderPlugin;
81
use Spryker\Zed\SalesServicePoint\Communication\Plugin\Sales\ServicePointOrderItemsPostSavePlugin;
82
use Spryker\Zed\SalesServicePoint\Communication\Plugin\Sales\ServicePointSalesOrderItemCollectionPostUpdatePlugin;
83
use Spryker\Zed\SalesServicePoint\Communication\Plugin\Sales\ServicePointSalesOrderItemCollectionPreDeletePlugin;
84
use Spryker\Zed\Shipment\Communication\Plugin\ShipmentOrderHydratePlugin;
85
use Spryker\Zed\WarehouseAllocation\Communication\Plugin\Sales\WarehouseOrderItemExpanderPlugin;
86
87
class SalesDependencyProvider extends SprykerSalesDependencyProvider
88
{
89
    /**
90
     * @return array<\Spryker\Zed\Sales\Dependency\Plugin\OrderExpanderPreSavePluginInterface>
91
     */
92
    protected function getOrderExpanderPreSavePlugins(): array
93
    {
94
        return [
95
            new OmsMultiThreadProcessorIdentifierOrderExpanderPreSavePlugin(),
96
        ];
97
    }
98
99
    /**
100
     * @return array<\Spryker\Zed\SalesExtension\Dependency\Plugin\OrderExpanderPluginInterface>
101
     */
102
    protected function getOrderHydrationPlugins(): array
103
    {
104
        return [
105
            new ProductBundleOrderHydratePlugin(),
106
            new DiscountOrderHydratePlugin(),
107
            new ShipmentOrderHydratePlugin(),
108
            new SalesPaymentOrderExpanderPlugin(),
109
            new CustomerOrderHydratePlugin(),
110
            new ProductBundleIdHydratorPlugin(),
111
            new ProductOptionGroupIdHydratorPlugin(),
112
            new ProductBundleOptionOrderExpanderPlugin(),
113
            new RemunerationTotalOrderExpanderPlugin(),
114
            new OmsStatesOrderExpanderPlugin(),
115
            new IsCancellableOrderExpanderPlugin(),
116
            new CurrencyOrderExpanderPlugin(),
117
            new MerchantOrderDataOrderExpanderPlugin(),
118
            new MerchantReferencesOrderExpanderPlugin(),
119
            new MerchantDataOrderHydratePlugin(),
120
            new SalesOrderAmendmentOrderExpanderPlugin(),
121
            new IsAmendableOrderExpanderPlugin(),
122
        ];
123
    }
124
125
    /**
126
     * @return list<\Spryker\Zed\SalesExtension\Dependency\Plugin\OrderPostSavePluginInterface>
127
     */
128
    protected function getOrderPostSavePluginsForOrderAmendment(): array
129
    {
130
        return [
0 ignored issues
show
Bug Best Practice introduced by
The expression return array(new Spryker...tOrderPostSavePlugin()) returns the type array<integer,Spryker\Ze...entOrderPostSavePlugin> which is incompatible with the documented return type Pyz\Zed\Sales\list.
Loading history...
131
            new UpdateOrderCustomReferenceOrderPostSavePlugin(),
132
            new CreateSalesOrderAmendmentOrderPostSavePlugin(),
133
        ];
134
    }
135
136
    /**
137
     * @return array<\Spryker\Zed\SalesExtension\Dependency\Plugin\OrderItemExpanderPreSavePluginInterface>
138
     */
139
    protected function getOrderItemExpanderPreSavePlugins(): array
140
    {
141
        return [
142
            new IsQuantitySplittableOrderItemExpanderPreSavePlugin(),
143
            new OrderItemReferenceExpanderPreSavePlugin(),
144
            new MerchantReferenceOrderItemExpanderPreSavePlugin(),
145
            new ProductOfferReferenceOrderItemExpanderPreSavePlugin(),
146
        ];
147
    }
148
149
    /**
150
     * @return array<\Spryker\Zed\SalesExtension\Dependency\Plugin\ItemTransformerStrategyPluginInterface>
151
     */
152
    public function getItemTransformerStrategyPlugins(): array
153
    {
154
        return [
155
            new NonSplittableItemTransformerStrategyPlugin(),
156
        ];
157
    }
158
159
    /**
160
     * @return array<\Spryker\Zed\SalesExtension\Dependency\Plugin\SalesTablePluginInterface>
161
     */
162
    protected function getSalesTablePlugins(): array
163
    {
164
        return [
165
            new ReclamationSalesTablePlugin(),
166
        ];
167
    }
168
169
    /**
170
     * @return array<\Spryker\Zed\SalesExtension\Dependency\Plugin\OrderPostSavePluginInterface>
171
     */
172
    protected function getOrderPostSavePlugins(): array
173
    {
174
        return [
175
            new OrderCustomReferenceOrderPostSavePlugin(),
176
        ];
177
    }
178
179
    /**
180
     * @return array<\Spryker\Zed\SalesExtension\Dependency\Plugin\ItemPreTransformerPluginInterface>
181
     */
182
    protected function getItemPreTransformerPlugins(): array
183
    {
184
        return [
185
            new ConfiguredBundleItemPreTransformerPlugin(),
186
        ];
187
    }
188
189
    /**
190
     * @return array<\Spryker\Zed\SalesExtension\Dependency\Plugin\UniqueOrderItemsExpanderPluginInterface>
191
     */
192
    protected function getUniqueOrderItemsExpanderPlugins(): array
193
    {
194
        return [
195
            new UniqueOrderBundleItemsExpanderPlugin(),
196
        ];
197
    }
198
199
    /**
200
     * @return array<\Spryker\Zed\SalesExtension\Dependency\Plugin\OrderItemExpanderPluginInterface>
201
     */
202
    protected function getOrderItemExpanderPlugins(): array
203
    {
204
        return [
205
            new StateHistoryOrderItemExpanderPlugin(),
206
            new ProductIdOrderItemExpanderPlugin(),
207
            new ProductOptionsOrderItemExpanderPlugin(),
208
            new MetadataOrderItemExpanderPlugin(),
209
            new UpdateOrderItemIsReturnableByItemStatePlugin(),
210
            new UpdateOrderItemIsReturnableByGlobalReturnableNumberOfDaysPlugin(),
211
            new CurrencyIsoCodeOrderItemExpanderPlugin(),
212
            new ConfiguredBundleOrderItemExpanderPlugin(),
213
            new ProductBundleOrderItemExpanderPlugin(),
214
            new ProductBundleOptionItemExpanderPlugin(),
215
            new ItemStateOrderItemExpanderPlugin(),
216
            new ProductConfigurationOrderItemExpanderPlugin(),
217
            new WarehouseOrderItemExpanderPlugin(),
218
            new ServicePointOrderItemExpanderPlugin(),
219
        ];
220
    }
221
222
    /**
223
     * @return array<\Spryker\Zed\SalesExtension\Dependency\Plugin\SearchOrderExpanderPluginInterface>
224
     */
225
    protected function getSearchOrderExpanderPlugins(): array
226
    {
227
        return [
228
            new ItemMetadataSearchOrderExpanderPlugin(),
229
            new OrderAggregatedItemStateSearchOrderExpanderPlugin(),
230
            new IsCancellableSearchOrderExpanderPlugin(),
231
            new IsAmendableOrderSearchOrderExpanderPlugin(),
232
        ];
233
    }
234
235
    /**
236
     * @return array<\Spryker\Zed\SalesExtension\Dependency\Plugin\OrderItemsPostSavePluginInterface>
237
     */
238
    protected function getOrderItemsPostSavePlugins(): array
239
    {
240
        return [
241
            new ConfiguredBundlesOrderItemsPostSavePlugin(),
242
            new ItemMetadataOrderItemsPostSavePlugin(),
243
            new ProductConfigurationOrderItemsPostSavePlugin(),
244
            new ServicePointOrderItemsPostSavePlugin(),
245
            new GiftCardOrderItemsPostSavePlugin(),
246
            new ProductOptionOrderItemsPostSavePlugin(),
247
        ];
248
    }
249
250
    /**
251
     * @return list<\Spryker\Zed\SalesExtension\Dependency\Plugin\SalesExpensePreDeletePluginInterface>
252
     */
253
    protected function getSalesExpensePreDeletePlugins(): array
254
    {
255
        return [
0 ignored issues
show
Bug Best Practice introduced by
The expression return array(new Spryker...pensePreDeletePlugin()) returns the type array<integer,Spryker\Ze...ExpensePreDeletePlugin> which is incompatible with the documented return type Pyz\Zed\Sales\list.
Loading history...
256
            new SalesDiscountSalesExpensePreDeletePlugin(),
257
        ];
258
    }
259
260
    /**
261
     * @return list<\Spryker\Zed\SalesExtension\Dependency\Plugin\SalesOrderItemCollectionPreDeletePluginInterface>
262
     */
263
    protected function getSalesOrderItemCollectionPreDeletePlugins(): array
264
    {
265
        return [
266
            new DiscountSalesOrderItemCollectionPreDeletePlugin(),
267
            new ItemMetadataSalesOrderItemCollectionPreDeletePlugin(),
268
            new OmsItemHistorySalesOrderItemCollectionPreDeletePlugin(),
269
            new ProductOptionSalesOrderItemCollectionPreDeletePlugin(),
270
            new ServicePointSalesOrderItemCollectionPreDeletePlugin(),
271
            new SalesConfigurableBundleSalesOrderItemCollectionPreDeletePlugin(),
272
            new SalesProductConfigurationSalesOrderItemCollectionPreDeletePlugin(),
273
            new GiftCardSalesOrderItemCollectionPreDeletePlugin(),
274
            new NopaymentSalesOrderItemCollectionPreDeletePlugin(),
275
            new SalesReclamationSalesOrderItemCollectionPreDeletePlugin(),
276
        ];
277
    }
278
279
    /**
280
     * @return list<\Spryker\Zed\SalesExtension\Dependency\Plugin\SalesOrderItemCollectionPostUpdatePluginInterface>
281
     */
282
    protected function getOrderItemCollectionPostUpdatePlugins(): array
283
    {
284
        return [
285
            new SalesConfiguredBundlesSalesOrderItemCollectionPostUpdatePlugin(),
286
            new SalesProductConfigurationSalesOrderItemCollectionPostUpdatePlugin(),
287
            new ItemMetadataSalesOrderItemCollectionPostUpdatePlugin(),
288
            new ServicePointSalesOrderItemCollectionPostUpdatePlugin(),
289
            new ProductOptionSalesOrderItemCollectionPostUpdatePlugin(),
290
        ];
291
    }
292
293
    /**
294
     * @return list<\Spryker\Zed\SalesExtension\Dependency\Plugin\OrderItemInitialStateProviderPluginInterface>
295
     */
296
    protected function getOrderItemInitialStateProviderPlugins(): array
297
    {
298
        return [
0 ignored issues
show
Bug Best Practice introduced by
The expression return array(new Spryker...lStateProviderPlugin()) returns the type array<integer,Spryker\Ze...ialStateProviderPlugin> which is incompatible with the documented return type Pyz\Zed\Sales\list.
Loading history...
299
            new DefaultOrderItemInitialStateProviderPlugin(),
300
        ];
301
    }
302
303
    /**
304
     * @return list<\Spryker\Zed\SalesExtension\Dependency\Plugin\OrderItemInitialStateProviderPluginInterface>
305
     */
306
    protected function getOrderItemInitialStateProviderPluginsForOrderAmendment(): array
307
    {
308
        return [
0 ignored issues
show
Bug Best Practice introduced by
The expression return array(new Spryker...lStateProviderPlugin()) returns the type array<integer,Spryker\Ze...ialStateProviderPlugin> which is incompatible with the documented return type Pyz\Zed\Sales\list.
Loading history...
309
            new OrderAmendmentDefaultOrderItemInitialStateProviderPlugin(),
310
        ];
311
    }
312
313
    /**
314
     * @return array<\Spryker\Zed\SalesExtension\Dependency\Plugin\OrderItemsTableExpanderPluginInterface>
315
     */
316
    protected function getOrderItemsTableExpanderPlugins(): array
317
    {
318
        return [
319
            new MerchantOmsStateOrderItemsTableExpanderPlugin(),
320
        ];
321
    }
322
323
    /**
324
     * @return list<\Spryker\Zed\SalesExtension\Dependency\Plugin\OrderPostCancelPluginInterface>
325
     */
326
    protected function getOrderPostCancelPlugins(): array
327
    {
328
        return [
0 ignored issues
show
Bug Best Practice introduced by
The expression return array(new Spryker...rderPostCancelPlugin()) returns the type array<integer,Spryker\Ze...nOrderPostCancelPlugin> which is incompatible with the documented return type Pyz\Zed\Sales\list.
Loading history...
329
            new MerchantCommissionOrderPostCancelPlugin(),
330
        ];
331
    }
332
}
333