Completed
Push — master ( f465c8...ce649b )
by Ilya
52s queued 19s
created

  A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 4
c 0
b 0
f 0
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\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\SessionAgentValidation\Plugin\CustomerPage\UpdateAgentSessionAfterCustomerAuthenticationSuccessPlugin;
24
25
class CustomerPageDependencyProvider extends SprykerShopCustomerPageDependencyProvider
26
{
27
    /**
28
     * @var string
29
     */
30
    public const CLIENT_PYZ_SESSION = 'CLIENT_PYZ_SESSION';
31
32
    /**
33
     * @param \Spryker\Yves\Kernel\Container $container
34
     *
35
     * @return \Spryker\Yves\Kernel\Container
36
     */
37
    public function provideDependencies(Container $container): Container
38
    {
39
        $container = parent::provideDependencies($container);
40
41
        $container = $this->addPyzSessionClient($container);
42
43
        return $container;
44
    }
45
46
    /**
47
     * @return array<\SprykerShop\Yves\CustomerPageExtension\Dependency\Plugin\PreRegistrationCustomerTransferExpanderPluginInterface>
48
     */
49
    protected function getPreRegistrationCustomerTransferExpanderPlugins(): array
50
    {
51
        return [
52
            new CompanyUserInvitationPreRegistrationCustomerTransferExpanderPlugin(), #BulkImportCompanyUserInvitationsFeature
53
        ];
54
    }
55
56
    /**
57
     * @return array<\SprykerShop\Yves\CustomerPageExtension\Dependency\Plugin\CustomerRedirectStrategyPluginInterface>
58
     */
59
    protected function getAfterLoginCustomerRedirectPlugins(): array
60
    {
61
        return [
62
            new BusinessOnBehalfCompanyUserRedirectAfterLoginStrategyPlugin(), #BusinessOnBehalfFeature
63
            new RedirectUriCustomerRedirectStrategyPlugin(),
64
        ];
65
    }
66
67
    /**
68
     * @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...
69
     */
70
    protected function getAfterCustomerAuthenticationSuccessPlugins(): array
71
    {
72
        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...
73
            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

73
            /** @scrutinizer ignore-deprecated */ new FixAgentTokenAfterCustomerAuthenticationSuccessPlugin(),
Loading history...
74
            new UpdateAgentTokenAfterCustomerAuthenticationSuccessPlugin(),
75
            new UpdateAgentSessionAfterCustomerAuthenticationSuccessPlugin(),
76
        ];
77
    }
78
79
    /**
80
     * @param \Spryker\Yves\Kernel\Container $container
81
     *
82
     * @return \Spryker\Yves\Kernel\Container
83
     */
84
    protected function addPyzSessionClient(Container $container): Container
85
    {
86
        $container->set(static::CLIENT_PYZ_SESSION, function (Container $container) {
87
            return $container->getLocator()->session()->client();
88
        });
89
90
        return $container;
91
    }
92
93
    /**
94
     * @return array<\SprykerShop\Yves\CustomerPageExtension\Dependency\Plugin\OrderSearchFormExpanderPluginInterface>
95
     */
96
    protected function getOrderSearchFormExpanderPlugins(): array
97
    {
98
        return [
99
            new CompanyBusinessUnitOrderSearchFormExpanderPlugin(),
100
        ];
101
    }
102
103
    /**
104
     * @return array<\SprykerShop\Yves\CustomerPageExtension\Dependency\Plugin\OrderSearchFormHandlerPluginInterface>
105
     */
106
    protected function getOrderSearchFormHandlerPlugins(): array
107
    {
108
        return [
109
            new CompanyBusinessUnitOrderSearchFormHandlerPlugin(),
110
        ];
111
    }
112
113
    /**
114
     * @return array<\SprykerShop\Yves\CustomerPageExtension\Dependency\Plugin\PreAuthUserCheckPluginInterface>
115
     */
116
    protected function getPreAuthUserCheckPlugins(): array
117
    {
118
        return [
119
            new CompanyUserPreAuthUserCheckPlugin(),
120
        ];
121
    }
122
123
    /**
124
     * @return array<\SprykerShop\Yves\CustomerPageExtension\Dependency\Plugin\AuthenticationHandlerPluginInterface>
125
     */
126
    protected function getCustomerAuthenticationHandlerPlugins(): array
127
    {
128
        return [
129
            new CustomerMultiFactorAuthenticationHandlerPlugin(),
130
        ];
131
    }
132
}
133