Passed
Push — master ( 69de9a...408b4b )
by Olha
05:11
created

CustomerPageDependencyProvider::addSessionClient()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 7
c 0
b 0
f 0
rs 10
cc 1
nc 1
nop 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\Yves\CustomerPage;
11
12
use Spryker\Yves\Kernel\Container;
13
use Spryker\Yves\MerchantShipment\Plugin\CustomerPage\MerchantShipmentCheckoutAddressStepPreGroupItemsByShipmentPlugin;
14
use Spryker\Yves\MultiFactorAuth\Plugin\AuthenticationHandler\Customer\CustomerMultiFactorAuthenticationHandlerPlugin;
15
use SprykerShop\Yves\AgentPage\Plugin\Security\UpdateAgentTokenAfterCustomerAuthenticationSuccessPlugin;
16
use SprykerShop\Yves\CompanyPage\Plugin\CustomerPage\BusinessOnBehalfCompanyUserRedirectAfterLoginStrategyPlugin;
17
use SprykerShop\Yves\CompanyPage\Plugin\CustomerPage\CompanyBusinessUnitOrderSearchFormExpanderPlugin;
18
use SprykerShop\Yves\CompanyPage\Plugin\CustomerPage\CompanyBusinessUnitOrderSearchFormHandlerPlugin;
19
use SprykerShop\Yves\CompanyPage\Plugin\CustomerPage\CompanyUserPreAuthUserCheckPlugin;
20
use SprykerShop\Yves\CompanyUserInvitationPage\Plugin\CompanyUserInvitationPreRegistrationCustomerTransferExpanderPlugin;
21
use SprykerShop\Yves\CustomerPage\CustomerPageDependencyProvider as SprykerShopCustomerPageDependencyProvider;
22
use SprykerShop\Yves\CustomerPage\Plugin\CustomerPage\RedirectUriCustomerRedirectStrategyPlugin;
23
use SprykerShop\Yves\CustomerReorderWidget\Plugin\CustomerPage\CustomerReorderWidgetPlugin;
24
use SprykerShop\Yves\SessionAgentValidation\Plugin\CustomerPage\UpdateAgentSessionAfterCustomerAuthenticationSuccessPlugin;
25
26
class CustomerPageDependencyProvider extends SprykerShopCustomerPageDependencyProvider
27
{
28
    /**
29
     * @var string
30
     */
31
    public const CLIENT_PYZ_SESSION = 'CLIENT_PYZ_SESSION';
32
33
    /**
34
     * @param \Spryker\Yves\Kernel\Container $container
35
     *
36
     * @return \Spryker\Yves\Kernel\Container
37
     */
38
    public function provideDependencies(Container $container): Container
39
    {
40
        $container = parent::provideDependencies($container);
41
42
        $container = $this->addPyzSessionClient($container);
43
44
        return $container;
45
    }
46
47
    /**
48
     * @return array<string>
49
     */
50
    protected function getCustomerOverviewWidgetPlugins(): array
51
    {
52
        return [
53
            CustomerReorderWidgetPlugin::class,
54
        ];
55
    }
56
57
    /**
58
     * @return array<string>
59
     */
60
    protected function getCustomerOrderListWidgetPlugins(): array
61
    {
62
        return [
63
            CustomerReorderWidgetPlugin::class,
64
        ];
65
    }
66
67
    /**
68
     * @return array<string>
69
     */
70
    protected function getCustomerOrderViewWidgetPlugins(): array
71
    {
72
        return [
73
            CustomerReorderWidgetPlugin::class,
74
        ];
75
    }
76
77
    /**
78
     * @return array<\SprykerShop\Yves\CustomerPageExtension\Dependency\Plugin\PreRegistrationCustomerTransferExpanderPluginInterface>
79
     */
80
    protected function getPreRegistrationCustomerTransferExpanderPlugins(): array
81
    {
82
        return [
83
            new CompanyUserInvitationPreRegistrationCustomerTransferExpanderPlugin(), #BulkImportCompanyUserInvitationsFeature
84
        ];
85
    }
86
87
    /**
88
     * @return array<\SprykerShop\Yves\CustomerPageExtension\Dependency\Plugin\CustomerRedirectStrategyPluginInterface>
89
     */
90
    protected function getAfterLoginCustomerRedirectPlugins(): array
91
    {
92
        return [
93
            new BusinessOnBehalfCompanyUserRedirectAfterLoginStrategyPlugin(), #BusinessOnBehalfFeature
94
            new RedirectUriCustomerRedirectStrategyPlugin(),
95
        ];
96
    }
97
98
    /**
99
     * @return list<\SprykerShop\Yves\CustomerPageExtension\Dependency\Plugin\AfterCustomerAuthenticationSuccessPluginInterface>
100
     */
101
    protected function getAfterCustomerAuthenticationSuccessPlugins(): array
102
    {
103
        return [
0 ignored issues
show
Bug Best Practice introduced by
The expression return array(new Spryker...icationSuccessPlugin()) returns the type array<integer,SprykerSho...nticationSuccessPlugin> which is incompatible with the documented return type Pyz\Yves\CustomerPage\list.
Loading history...
104
            new UpdateAgentTokenAfterCustomerAuthenticationSuccessPlugin(),
105
            new UpdateAgentSessionAfterCustomerAuthenticationSuccessPlugin(),
106
        ];
107
    }
108
109
    /**
110
     * @param \Spryker\Yves\Kernel\Container $container
111
     *
112
     * @return \Spryker\Yves\Kernel\Container
113
     */
114
    protected function addPyzSessionClient(Container $container): Container
115
    {
116
        $container->set(static::CLIENT_PYZ_SESSION, function (Container $container) {
117
            return $container->getLocator()->session()->client();
118
        });
119
120
        return $container;
121
    }
122
123
    /**
124
     * @return array<\SprykerShop\Yves\CustomerPageExtension\Dependency\Plugin\OrderSearchFormExpanderPluginInterface>
125
     */
126
    protected function getOrderSearchFormExpanderPlugins(): array
127
    {
128
        return [
129
            new CompanyBusinessUnitOrderSearchFormExpanderPlugin(),
130
        ];
131
    }
132
133
    /**
134
     * @return array<\SprykerShop\Yves\CustomerPageExtension\Dependency\Plugin\OrderSearchFormHandlerPluginInterface>
135
     */
136
    protected function getOrderSearchFormHandlerPlugins(): array
137
    {
138
        return [
139
            new CompanyBusinessUnitOrderSearchFormHandlerPlugin(),
140
        ];
141
    }
142
143
    /**
144
     * @return array<\SprykerShop\Yves\CustomerPageExtension\Dependency\Plugin\PreAuthUserCheckPluginInterface>
145
     */
146
    protected function getPreAuthUserCheckPlugins(): array
147
    {
148
        return [
149
            new CompanyUserPreAuthUserCheckPlugin(),
150
        ];
151
    }
152
153
    /**
154
     * @return array<\SprykerShop\Yves\CustomerPageExtension\Dependency\Plugin\CheckoutAddressStepPreGroupItemsByShipmentPluginInterface>
155
     */
156
    protected function getCheckoutAddressStepPreGroupItemsByShipmentPlugins(): array
157
    {
158
        return [
159
            new MerchantShipmentCheckoutAddressStepPreGroupItemsByShipmentPlugin(),
160
        ];
161
    }
162
163
    /**
164
     * @return array<\SprykerShop\Yves\CustomerPageExtension\Dependency\Plugin\AuthenticationHandlerPluginInterface>
165
     */
166
    protected function getCustomerAuthenticationHandlerPlugins(): array
167
    {
168
        return [
169
            new CustomerMultiFactorAuthenticationHandlerPlugin(),
170
        ];
171
    }
172
}
173