Completed
Push — master ( 9cde57...7da072 )
by Anna
49s queued 13s
created

getProductAbstractReadinessProviderPlugins()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 10
c 1
b 0
f 0
dl 0
loc 12
rs 9.9332
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\ProductManagement;
11
12
use Spryker\Zed\CmsBlockProductConnector\Communication\Plugin\CmsBlockProductAbstractBlockListViewPlugin;
13
use Spryker\Zed\Kernel\Communication\Form\FormTypeInterface;
14
use Spryker\Zed\Kernel\Container;
15
use Spryker\Zed\MerchantGui\Communication\Plugin\ProductManagement\MerchantProductAbstractListActionViewDataExpanderPlugin;
16
use Spryker\Zed\MerchantProductGui\Communication\Plugin\ProductManagement\MerchantProductProductAbstractEditViewExpanderPlugin;
17
use Spryker\Zed\MerchantProductGui\Communication\Plugin\ProductManagement\MerchantProductProductAbstractViewActionViewDataExpanderPlugin;
18
use Spryker\Zed\MerchantProductGui\Communication\Plugin\ProductManagement\MerchantProductProductTableQueryCriteriaExpanderPlugin;
19
use Spryker\Zed\MoneyGui\Communication\Plugin\Form\MoneyFormTypePlugin;
20
use Spryker\Zed\PriceProductMerchantRelationshipGui\Communication\Plugin\ProductManagement\MerchantRelationshipProductAbstractFormExpanderPlugin;
21
use Spryker\Zed\PriceProductMerchantRelationshipGui\Communication\Plugin\ProductManagement\MerchantRelationshipProductConcreteFormExpanderPlugin;
22
use Spryker\Zed\PriceProductScheduleGui\Communication\Plugin\ProductManagement\ScheduledPriceProductAbstractEditViewExpanderPlugin;
23
use Spryker\Zed\PriceProductScheduleGui\Communication\Plugin\ProductManagement\ScheduledPriceProductAbstractFormEditTabsExpanderPlugin;
24
use Spryker\Zed\PriceProductScheduleGui\Communication\Plugin\ProductManagement\ScheduledPriceProductConcreteEditViewExpanderPlugin;
25
use Spryker\Zed\PriceProductScheduleGui\Communication\Plugin\ProductManagement\ScheduledPriceProductConcreteFormEditTabsExpanderPlugin;
26
use Spryker\Zed\PriceProductStorage\Communication\Plugin\ProductManagement\StoragePriceProductAbstractReadinessProviderPlugin;
27
use Spryker\Zed\PriceProductStorage\Communication\Plugin\ProductManagement\StorageTablePriceProductAbstractReadinessProviderPlugin;
28
use Spryker\Zed\PriceProductStorage\Communication\Plugin\ProductManagement\StorageTablePriceProductConcreteReadinessProviderPlugin;
29
use Spryker\Zed\Product\Communication\Plugin\ProductManagement\IsActiveAbstractProductReadinessProviderPlugin;
30
use Spryker\Zed\Product\Communication\Plugin\ProductManagement\IsActiveConcreteProductReadinessProviderPlugin;
31
use Spryker\Zed\Product\Communication\Plugin\ProductManagement\StoreRelationAbstractProductReadinessProviderPlugin;
32
use Spryker\Zed\ProductAlternativeGui\Communication\Plugin\ProductManagement\ProductConcreteEditFormExpanderPlugin;
33
use Spryker\Zed\ProductAlternativeGui\Communication\Plugin\ProductManagement\ProductConcreteFormEditDataProviderExpanderPlugin;
34
use Spryker\Zed\ProductAlternativeGui\Communication\Plugin\ProductManagement\ProductConcreteFormEditTabsExpanderPlugin;
35
use Spryker\Zed\ProductAlternativeGui\Communication\Plugin\ProductManagement\ProductFormTransferMapperExpanderPlugin;
36
use Spryker\Zed\ProductApproval\Communication\Plugin\ProductManagement\ApprovalStatusAbstractProductReadinessProviderPlugin;
37
use Spryker\Zed\ProductApprovalGui\Communication\Plugin\ProductManagement\ProductApprovalProductAbstractEditViewExpanderPlugin;
38
use Spryker\Zed\ProductApprovalGui\Communication\Plugin\ProductManagement\ProductApprovalProductTableActionExpanderPlugin;
39
use Spryker\Zed\ProductApprovalGui\Communication\Plugin\ProductManagement\ProductApprovalProductTableConfigurationExpanderPlugin;
40
use Spryker\Zed\ProductApprovalGui\Communication\Plugin\ProductManagement\ProductApprovalProductTableDataBulkExpanderPlugin;
41
use Spryker\Zed\ProductApprovalGui\Communication\Plugin\ProductManagement\ProductApprovalProductTableQueryCriteriaExpanderPlugin;
42
use Spryker\Zed\ProductConfigurationGui\Communication\Plugin\ProductManagement\ProductConfigurationProductTableDataBulkExpanderPlugin;
43
use Spryker\Zed\ProductDiscontinuedGui\Communication\Plugin\DiscontinuedNotesProductFormTransferMapperExpanderPlugin;
44
use Spryker\Zed\ProductDiscontinuedGui\Communication\Plugin\DiscontinuedProductConcreteEditFormExpanderPlugin;
45
use Spryker\Zed\ProductDiscontinuedGui\Communication\Plugin\DiscontinueProductConcreteFormEditDataProviderExpanderPlugin;
46
use Spryker\Zed\ProductDiscontinuedGui\Communication\Plugin\DiscontinueProductConcreteFormEditTabsExpanderPlugin;
47
use Spryker\Zed\ProductManagement\ProductManagementDependencyProvider as SprykerProductManagementDependencyProvider;
48
use Spryker\Zed\ProductPageSearch\Communication\Plugin\ProductManagement\PageSearchProductAbstractReadinessProviderPlugin;
49
use Spryker\Zed\ProductSearch\Communication\Plugin\ProductManagement\IsSearchableForLocaleAbstractProductReadinessProviderPlugin;
50
use Spryker\Zed\ProductSearch\Communication\Plugin\ProductManagement\IsSearchableForLocaleConcreteProductReadinessProviderPlugin;
51
use Spryker\Zed\ProductStorage\Communication\Plugin\ProductManagement\StorageProductAbstractReadinessProviderPlugin;
52
use Spryker\Zed\ProductStorage\Communication\Plugin\ProductManagement\StorageTableProductAbstractReadinessProviderPlugin;
53
use Spryker\Zed\ProductStorage\Communication\Plugin\ProductManagement\StorageTableProductConcreteReadinessProviderPlugin;
54
use Spryker\Zed\Store\Communication\Plugin\Form\StoreRelationToggleFormTypePlugin;
55
56
class ProductManagementDependencyProvider extends SprykerProductManagementDependencyProvider
57
{
58
    /**
59
     * @return array<\Spryker\Zed\ProductManagement\Communication\Plugin\ProductAbstractViewPluginInterface>
60
     */
61
    protected function getProductAbstractViewPlugins(): array
62
    {
63
        return [
64
            new CmsBlockProductAbstractBlockListViewPlugin(),
65
        ];
66
    }
67
68
    /**
69
     * @return \Spryker\Zed\Kernel\Communication\Form\FormTypeInterface
70
     */
71
    protected function getStoreRelationFormTypePlugin(): FormTypeInterface
72
    {
73
        return new StoreRelationToggleFormTypePlugin();
74
    }
75
76
    /**
77
     * @param \Spryker\Zed\Kernel\Container $container
78
     *
79
     * @return \Spryker\Zed\Kernel\Communication\Form\FormTypeInterface
80
     */
81
    protected function createMoneyFormTypePlugin(Container $container): FormTypeInterface // phpcs:ignore SlevomatCodingStandard.Functions.UnusedParameter
82
    {
83
        return new MoneyFormTypePlugin();
84
    }
85
86
    /**
87
     * @return array<\Spryker\Zed\ProductManagementExtension\Dependency\Plugin\ProductConcreteFormEditTabsExpanderPluginInterface>
88
     */
89
    protected function getProductConcreteFormEditTabsExpanderPlugins(): array
90
    {
91
        return [
92
            new DiscontinueProductConcreteFormEditTabsExpanderPlugin(), #ProductDiscontinuedFeature
93
            new ProductConcreteFormEditTabsExpanderPlugin(), #ProductAlternativeFeature
94
            new ScheduledPriceProductConcreteFormEditTabsExpanderPlugin(),
95
        ];
96
    }
97
98
    /**
99
     * @return array<\Spryker\Zed\ProductManagementExtension\Dependency\Plugin\ProductConcreteEditFormExpanderPluginInterface>
100
     */
101
    protected function getProductConcreteEditFormExpanderPlugins(): array
102
    {
103
        return [
104
            new DiscontinuedProductConcreteEditFormExpanderPlugin(), #ProductDiscontinuedFeature
105
            new ProductConcreteEditFormExpanderPlugin(), #ProductAlternativeFeature
106
        ];
107
    }
108
109
    /**
110
     * @return array<\Spryker\Zed\ProductManagementExtension\Dependency\Plugin\ProductConcreteFormEditDataProviderExpanderPluginInterface>
111
     */
112
    protected function getProductConcreteFormEditDataProviderExpanderPlugins(): array
113
    {
114
        return [
115
            new DiscontinueProductConcreteFormEditDataProviderExpanderPlugin(), #ProductDiscontinuedFeature
116
            new ProductConcreteFormEditDataProviderExpanderPlugin(), #ProductAlternativeFeature
117
        ];
118
    }
119
120
    /**
121
     * @return array<\Spryker\Zed\ProductManagementExtension\Dependency\Plugin\ProductFormTransferMapperExpanderPluginInterface>
122
     */
123
    protected function getProductFormTransferMapperExpanderPlugins(): array
124
    {
125
        return [
0 ignored issues
show
Bug Best Practice introduced by
The expression return array(new Spryker...MapperExpanderPlugin()) returns the type array<integer,Spryker\Ze...erMapperExpanderPlugin> which is incompatible with the return type mandated by Spryker\Zed\ProductManag...MapperExpanderPlugins() of Spryker\Zed\ProductManag...panderPluginInterface[].

In the issue above, the returned value is violating the contract defined by the mentioned interface.

Let's take a look at an example:

interface HasName {
    /** @return string */
    public function getName();
}

class Name {
    public $name;
}

class User implements HasName {
    /** @return string|Name */
    public function getName() {
        return new Name('foo'); // This is a violation of the ``HasName`` interface
                                // which only allows a string value to be returned.
    }
}
Loading history...
126
            new ProductFormTransferMapperExpanderPlugin(), #ProductAlternativeFeature
127
            new DiscontinuedNotesProductFormTransferMapperExpanderPlugin(), #ProductDiscontinuedFeature
128
        ];
129
    }
130
131
    /**
132
     * @return array<\Spryker\Zed\ProductManagementExtension\Dependency\Plugin\ProductAbstractFormExpanderPluginInterface>
133
     */
134
    protected function getProductAbstractFormExpanderPlugins(): array
135
    {
136
        return [
137
            new MerchantRelationshipProductAbstractFormExpanderPlugin(),
138
        ];
139
    }
140
141
    /**
142
     * @return array<\Spryker\Zed\ProductManagementExtension\Dependency\Plugin\ProductConcreteFormExpanderPluginInterface>
143
     */
144
    protected function getProductConcreteFormExpanderPlugins(): array
145
    {
146
        return [
147
            new MerchantRelationshipProductConcreteFormExpanderPlugin(),
148
        ];
149
    }
150
151
    /**
152
     * @return array<\Spryker\Zed\ProductManagementExtension\Dependency\Plugin\ProductAbstractFormEditTabsExpanderPluginInterface>
153
     */
154
    protected function getProductAbstractFormEditTabsExpanderPlugins(): array
155
    {
156
        return [
157
            new ScheduledPriceProductAbstractFormEditTabsExpanderPlugin(),
158
        ];
159
    }
160
161
    /**
162
     * @return array<\Spryker\Zed\ProductManagementExtension\Dependency\Plugin\ProductAbstractEditViewExpanderPluginInterface>
163
     */
164
    protected function getProductAbstractEditViewExpanderPlugins(): array
165
    {
166
        return [
167
            new ScheduledPriceProductAbstractEditViewExpanderPlugin(),
168
            new ProductApprovalProductAbstractEditViewExpanderPlugin(),
169
            new MerchantProductProductAbstractEditViewExpanderPlugin(),
170
        ];
171
    }
172
173
    /**
174
     * @return array<\Spryker\Zed\ProductManagementExtension\Dependency\Plugin\ProductConcreteEditViewExpanderPluginInterface>
175
     */
176
    protected function getProductConcreteEditViewExpanderPlugins(): array
177
    {
178
        return [
179
            new ScheduledPriceProductConcreteEditViewExpanderPlugin(),
180
        ];
181
    }
182
183
    /**
184
     * @return array<\Spryker\Zed\ProductManagementExtension\Dependency\Plugin\ProductAbstractViewActionViewDataExpanderPluginInterface>
185
     */
186
    protected function getProductAbstractViewActionViewDataExpanderPlugins(): array
187
    {
188
        return [
189
            new MerchantProductProductAbstractViewActionViewDataExpanderPlugin(),
190
        ];
191
    }
192
193
    /**
194
     * @return array<\Spryker\Zed\ProductManagementExtension\Dependency\Plugin\ProductTableQueryCriteriaExpanderPluginInterface>
195
     */
196
    protected function getProductTableQueryCriteriaExpanderPluginInterfaces(): array
197
    {
198
        return [
199
            new MerchantProductProductTableQueryCriteriaExpanderPlugin(),
200
            new ProductApprovalProductTableQueryCriteriaExpanderPlugin(),
201
        ];
202
    }
203
204
    /**
205
     * @return array<\Spryker\Zed\ProductManagementExtension\Dependency\Plugin\ProductAbstractListActionViewDataExpanderPluginInterface>
206
     */
207
    protected function getProductAbstractListActionViewDataExpanderPlugins(): array
208
    {
209
        return [
210
            new MerchantProductAbstractListActionViewDataExpanderPlugin(),
211
        ];
212
    }
213
214
    /**
215
     * @return array<\Spryker\Zed\ProductManagementExtension\Dependency\Plugin\ProductTableConfigurationExpanderPluginInterface>
216
     */
217
    protected function getProductTableConfigurationExpanderPlugins(): array
218
    {
219
        return [
220
            new ProductApprovalProductTableConfigurationExpanderPlugin(),
221
        ];
222
    }
223
224
    /**
225
     * @return array<\Spryker\Zed\ProductManagementExtension\Dependency\Plugin\ProductTableDataBulkExpanderPluginInterface>
226
     */
227
    protected function getProductTableDataBulkExpanderPlugins(): array
228
    {
229
        return [
230
            new ProductApprovalProductTableDataBulkExpanderPlugin(),
231
            new ProductConfigurationProductTableDataBulkExpanderPlugin(),
232
        ];
233
    }
234
235
    /**
236
     * @return array<\Spryker\Zed\ProductManagementExtension\Dependency\Plugin\ProductTableActionExpanderPluginInterface>
237
     */
238
    protected function getProductTableActionExpanderPlugins(): array
239
    {
240
        return [
241
            new ProductApprovalProductTableActionExpanderPlugin(),
242
        ];
243
    }
244
245
     /**
246
      * @return array<\Spryker\Zed\ProductManagementExtension\Dependency\Plugin\ProductAbstractReadinessProviderPluginInterface>
247
      */
248
    protected function getProductAbstractReadinessProviderPlugins(): array
249
    {
250
        return [
251
            new ApprovalStatusAbstractProductReadinessProviderPlugin(),
252
            new IsActiveAbstractProductReadinessProviderPlugin(),
253
            new IsSearchableForLocaleAbstractProductReadinessProviderPlugin(),
254
            new StoreRelationAbstractProductReadinessProviderPlugin(),
255
            new StorageTableProductAbstractReadinessProviderPlugin(),
256
            new StorageProductAbstractReadinessProviderPlugin(),
257
            new PageSearchProductAbstractReadinessProviderPlugin(),
258
            new StorageTablePriceProductAbstractReadinessProviderPlugin(),
259
            new StoragePriceProductAbstractReadinessProviderPlugin(),
260
        ];
261
    }
262
263
    /**
264
     * @return array<\Spryker\Zed\ProductManagementExtension\Dependency\Plugin\ProductConcreteReadinessProviderPluginInterface>
265
     */
266
    protected function getProductConcreteReadinessProviderPlugins(): array
267
    {
268
        return [
269
            new IsActiveConcreteProductReadinessProviderPlugin(),
270
            new IsSearchableForLocaleConcreteProductReadinessProviderPlugin(),
271
            new StorageTablePriceProductConcreteReadinessProviderPlugin(),
272
            new StorageTableProductConcreteReadinessProviderPlugin(),
273
        ];
274
    }
275
}
276