getProductAbstractEditViewExpanderPlugins()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 2
c 0
b 0
f 0
dl 0
loc 4
rs 10
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\MoneyGui\Communication\Plugin\Form\MoneyFormTypePlugin;
16
use Spryker\Zed\PriceProductMerchantRelationshipGui\Communication\Plugin\ProductManagement\MerchantRelationshipProductAbstractFormExpanderPlugin;
17
use Spryker\Zed\PriceProductMerchantRelationshipGui\Communication\Plugin\ProductManagement\MerchantRelationshipProductConcreteFormExpanderPlugin;
18
use Spryker\Zed\PriceProductScheduleGui\Communication\Plugin\ProductManagement\ScheduledPriceProductAbstractEditViewExpanderPlugin;
19
use Spryker\Zed\PriceProductScheduleGui\Communication\Plugin\ProductManagement\ScheduledPriceProductAbstractFormEditTabsExpanderPlugin;
20
use Spryker\Zed\PriceProductScheduleGui\Communication\Plugin\ProductManagement\ScheduledPriceProductConcreteEditViewExpanderPlugin;
21
use Spryker\Zed\PriceProductScheduleGui\Communication\Plugin\ProductManagement\ScheduledPriceProductConcreteFormEditTabsExpanderPlugin;
22
use Spryker\Zed\ProductAlternativeGui\Communication\Plugin\ProductManagement\ProductConcreteEditFormExpanderPlugin;
23
use Spryker\Zed\ProductAlternativeGui\Communication\Plugin\ProductManagement\ProductConcreteFormEditDataProviderExpanderPlugin;
24
use Spryker\Zed\ProductAlternativeGui\Communication\Plugin\ProductManagement\ProductConcreteFormEditTabsExpanderPlugin;
25
use Spryker\Zed\ProductAlternativeGui\Communication\Plugin\ProductManagement\ProductFormTransferMapperExpanderPlugin;
26
use Spryker\Zed\ProductConfigurationGui\Communication\Plugin\ProductManagement\ProductConfigurationProductTableDataBulkExpanderPlugin;
27
use Spryker\Zed\ProductDiscontinuedGui\Communication\Plugin\DiscontinuedNotesProductFormTransferMapperExpanderPlugin;
28
use Spryker\Zed\ProductDiscontinuedGui\Communication\Plugin\DiscontinuedProductConcreteEditFormExpanderPlugin;
29
use Spryker\Zed\ProductDiscontinuedGui\Communication\Plugin\DiscontinueProductConcreteFormEditDataProviderExpanderPlugin;
30
use Spryker\Zed\ProductDiscontinuedGui\Communication\Plugin\DiscontinueProductConcreteFormEditTabsExpanderPlugin;
31
use Spryker\Zed\ProductManagement\ProductManagementDependencyProvider as SprykerProductManagementDependencyProvider;
32
use Spryker\Zed\Store\Communication\Plugin\Form\StoreRelationToggleFormTypePlugin;
33
34
class ProductManagementDependencyProvider extends SprykerProductManagementDependencyProvider
35
{
36
    /**
37
     * @return array<\Spryker\Zed\ProductManagement\Communication\Plugin\ProductAbstractViewPluginInterface>
38
     */
39
    protected function getProductAbstractViewPlugins(): array
40
    {
41
        return [
42
            new CmsBlockProductAbstractBlockListViewPlugin(),
43
        ];
44
    }
45
46
    protected function getStoreRelationFormTypePlugin(): FormTypeInterface
47
    {
48
        return new StoreRelationToggleFormTypePlugin();
49
    }
50
51
    protected function createMoneyFormTypePlugin(Container $container): FormTypeInterface // phpcs:ignore SlevomatCodingStandard.Functions.UnusedParameter
52
    {
53
        return new MoneyFormTypePlugin();
54
    }
55
56
    /**
57
     * @return array<\Spryker\Zed\ProductManagementExtension\Dependency\Plugin\ProductConcreteFormEditTabsExpanderPluginInterface>
58
     */
59
    protected function getProductConcreteFormEditTabsExpanderPlugins(): array
60
    {
61
        return [
62
            new DiscontinueProductConcreteFormEditTabsExpanderPlugin(), #ProductDiscontinuedFeature
63
            new ProductConcreteFormEditTabsExpanderPlugin(), #ProductAlternativeFeature
64
            new ScheduledPriceProductConcreteFormEditTabsExpanderPlugin(),
65
        ];
66
    }
67
68
    /**
69
     * @return array<\Spryker\Zed\ProductManagementExtension\Dependency\Plugin\ProductConcreteEditFormExpanderPluginInterface>
70
     */
71
    protected function getProductConcreteEditFormExpanderPlugins(): array
72
    {
73
        return [
74
            new DiscontinuedProductConcreteEditFormExpanderPlugin(), #ProductDiscontinuedFeature
75
            new ProductConcreteEditFormExpanderPlugin(), #ProductAlternativeFeature
76
        ];
77
    }
78
79
    /**
80
     * @return array<\Spryker\Zed\ProductManagementExtension\Dependency\Plugin\ProductConcreteFormEditDataProviderExpanderPluginInterface>
81
     */
82
    protected function getProductConcreteFormEditDataProviderExpanderPlugins(): array
83
    {
84
        return [
85
            new DiscontinueProductConcreteFormEditDataProviderExpanderPlugin(), #ProductDiscontinuedFeature
86
            new ProductConcreteFormEditDataProviderExpanderPlugin(), #ProductAlternativeFeature
87
        ];
88
    }
89
90
    /**
91
     * @return array<\Spryker\Zed\ProductManagementExtension\Dependency\Plugin\ProductFormTransferMapperExpanderPluginInterface>
92
     */
93
    protected function getProductFormTransferMapperExpanderPlugins(): array
94
    {
95
        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...
96
            new ProductFormTransferMapperExpanderPlugin(), #ProductAlternativeFeature
97
            new DiscontinuedNotesProductFormTransferMapperExpanderPlugin(), #ProductDiscontinuedFeature
98
        ];
99
    }
100
101
    /**
102
     * @return array<\Spryker\Zed\ProductManagementExtension\Dependency\Plugin\ProductAbstractFormExpanderPluginInterface>
103
     */
104
    protected function getProductAbstractFormExpanderPlugins(): array
105
    {
106
        return [
107
            new MerchantRelationshipProductAbstractFormExpanderPlugin(),
108
        ];
109
    }
110
111
    /**
112
     * @return array<\Spryker\Zed\ProductManagementExtension\Dependency\Plugin\ProductConcreteFormExpanderPluginInterface>
113
     */
114
    protected function getProductConcreteFormExpanderPlugins(): array
115
    {
116
        return [
117
            new MerchantRelationshipProductConcreteFormExpanderPlugin(),
118
        ];
119
    }
120
121
    /**
122
     * @return array<\Spryker\Zed\ProductManagementExtension\Dependency\Plugin\ProductAbstractFormEditTabsExpanderPluginInterface>
123
     */
124
    protected function getProductAbstractFormEditTabsExpanderPlugins(): array
125
    {
126
        return [
127
            new ScheduledPriceProductAbstractFormEditTabsExpanderPlugin(),
128
        ];
129
    }
130
131
    /**
132
     * @return array<\Spryker\Zed\ProductManagementExtension\Dependency\Plugin\ProductAbstractEditViewExpanderPluginInterface>
133
     */
134
    protected function getProductAbstractEditViewExpanderPlugins(): array
135
    {
136
        return [
137
            new ScheduledPriceProductAbstractEditViewExpanderPlugin(),
138
        ];
139
    }
140
141
    /**
142
     * @return array<\Spryker\Zed\ProductManagementExtension\Dependency\Plugin\ProductConcreteEditViewExpanderPluginInterface>
143
     */
144
    protected function getProductConcreteEditViewExpanderPlugins(): array
145
    {
146
        return [
147
            new ScheduledPriceProductConcreteEditViewExpanderPlugin(),
148
        ];
149
    }
150
151
    /**
152
     * @return array<\Spryker\Zed\ProductManagementExtension\Dependency\Plugin\ProductTableDataBulkExpanderPluginInterface>
153
     */
154
    protected function getProductTableDataBulkExpanderPlugins(): array
155
    {
156
        return [
157
            new ProductConfigurationProductTableDataBulkExpanderPlugin(),
158
        ];
159
    }
160
}
161