Completed
Push — master ( 24e5ac...c50c26 )
by Dmitry
53s queued 20s
created

addPyzSessionClient()   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
rs 10
c 0
b 0
f 0
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\MultiFactorAuth\Plugin\AuthenticationHandler\Customer\CustomerMultiFactorAuthenticationHandlerPlugin;
14
use SprykerShop\Yves\AgentPage\Plugin\FixAgentTokenAfterCustomerAuthenticationSuccessPlugin;
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>
0 ignored issues
show
Bug introduced by
The type Pyz\Yves\CustomerPage\list was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
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 FixAgentTokenAfterCustomerAuthenticationSuccessPlugin(),
0 ignored issues
show
Deprecated Code introduced by
The class SprykerShop\Yves\AgentPa...enticationSuccessPlugin has been deprecated: Use {@link \SprykerShop\Yves\AgentPage\Plugin\Security\UpdateAgentTokenAfterCustomerAuthenticationSuccessPlugin} instead. ( Ignorable by Annotation )

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

104
            /** @scrutinizer ignore-deprecated */ new FixAgentTokenAfterCustomerAuthenticationSuccessPlugin(),
Loading history...
105
            new UpdateAgentTokenAfterCustomerAuthenticationSuccessPlugin(),
106
            new UpdateAgentSessionAfterCustomerAuthenticationSuccessPlugin(),
107
        ];
108
    }
109
110
    /**
111
     * @param \Spryker\Yves\Kernel\Container $container
112
     *
113
     * @return \Spryker\Yves\Kernel\Container
114
     */
115
    protected function addPyzSessionClient(Container $container): Container
116
    {
117
        $container->set(static::CLIENT_PYZ_SESSION, function (Container $container) {
118
            return $container->getLocator()->session()->client();
119
        });
120
121
        return $container;
122
    }
123
124
    /**
125
     * @return array<\SprykerShop\Yves\CustomerPageExtension\Dependency\Plugin\OrderSearchFormExpanderPluginInterface>
126
     */
127
    protected function getOrderSearchFormExpanderPlugins(): array
128
    {
129
        return [
130
            new CompanyBusinessUnitOrderSearchFormExpanderPlugin(),
131
        ];
132
    }
133
134
    /**
135
     * @return array<\SprykerShop\Yves\CustomerPageExtension\Dependency\Plugin\OrderSearchFormHandlerPluginInterface>
136
     */
137
    protected function getOrderSearchFormHandlerPlugins(): array
138
    {
139
        return [
140
            new CompanyBusinessUnitOrderSearchFormHandlerPlugin(),
141
        ];
142
    }
143
144
    /**
145
     * @return array<\SprykerShop\Yves\CustomerPageExtension\Dependency\Plugin\PreAuthUserCheckPluginInterface>
146
     */
147
    protected function getPreAuthUserCheckPlugins(): array
148
    {
149
        return [
150
            new CompanyUserPreAuthUserCheckPlugin(),
151
        ];
152
    }
153
154
    /**
155
     * @return array<\SprykerShop\Yves\CustomerPageExtension\Dependency\Plugin\AuthenticationHandlerPluginInterface>
156
     */
157
    protected function getCustomerAuthenticationHandlerPlugins(): array
158
    {
159
        return [
160
            new CustomerMultiFactorAuthenticationHandlerPlugin(),
161
        ];
162
    }
163
}
164