CustomerDependencyProvider   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 5
eloc 13
dl 0
loc 48
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getCustomerSecuredPatternRulePlugins() 0 5 1
A getDefaultAddressChangePlugins() 0 4 1
A getCustomerSessionGetPlugins() 0 4 1
A getCustomerSessionSetPlugins() 0 6 1
A getAccessTokenAuthenticationHandlerPlugin() 0 3 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\Client\Customer;
11
12
use Spryker\Client\Agent\Plugin\Customer\AgentAccessCustomerSecuredPatternRulePlugin;
13
use Spryker\Client\Cart\Plugin\CustomerChangeCartUpdatePlugin;
14
use Spryker\Client\Customer\CustomerDependencyProvider as SprykerCustomerDependencyProvider;
15
use Spryker\Client\Customer\Plugin\CustomerAddressSessionUpdatePlugin;
16
use Spryker\Client\Customer\Plugin\CustomerTransferSessionRefreshPlugin;
17
use Spryker\Client\CustomerAccessPermission\Plugin\Customer\CustomerAccessSecuredPatternRulePlugin;
18
use Spryker\Client\CustomerExtension\Dependency\Plugin\AccessTokenAuthenticationHandlerPluginInterface;
19
use Spryker\Client\MultiCart\Plugin\GuestCartSaveCustomerSessionSetPlugin;
20
use Spryker\Client\OauthCompanyUser\Plugin\Customer\CompanyUserAccessTokenAuthenticationHandlerPlugin;
21
use Spryker\Client\PersistentCart\Plugin\GuestCartUpdateCustomerSessionSetPlugin;
22
23
class CustomerDependencyProvider extends SprykerCustomerDependencyProvider
24
{
25
    /**
26
     * @return array<\Spryker\Client\Customer\Dependency\Plugin\CustomerSessionGetPluginInterface>
27
     */
28
    protected function getCustomerSessionGetPlugins(): array
29
    {
30
        return [
31
            new CustomerTransferSessionRefreshPlugin(),
32
        ];
33
    }
34
35
    /**
36
     * @return array<\Spryker\Client\Customer\Dependency\Plugin\CustomerSessionSetPluginInterface>
37
     */
38
    protected function getCustomerSessionSetPlugins(): array
39
    {
40
        return [
41
            new GuestCartSaveCustomerSessionSetPlugin(), #MultiCartFeature
42
            new GuestCartUpdateCustomerSessionSetPlugin(), #PersistentCartFeature
43
            new CustomerChangeCartUpdatePlugin(),
44
        ];
45
    }
46
47
    /**
48
     * @return array<\Spryker\Client\Customer\Dependency\Plugin\DefaultAddressChangePluginInterface>
49
     */
50
    protected function getDefaultAddressChangePlugins(): array
51
    {
52
        return [
53
            new CustomerAddressSessionUpdatePlugin(),
0 ignored issues
show
Deprecated Code introduced by
The class Spryker\Client\Customer\...ressSessionUpdatePlugin has been deprecated: Use {@link \Spryker\Client\Customer\Plugin\Customer\CustomerAddressDefaultAddressChangePlugin} instead. ( Ignorable by Annotation )

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

53
            /** @scrutinizer ignore-deprecated */ new CustomerAddressSessionUpdatePlugin(),
Loading history...
54
        ];
55
    }
56
57
    /**
58
     * @return array<\Spryker\Client\CustomerExtension\Dependency\Plugin\CustomerSecuredPatternRulePluginInterface>
59
     */
60
    protected function getCustomerSecuredPatternRulePlugins(): array
61
    {
62
        return [
63
            new CustomerAccessSecuredPatternRulePlugin(), #CustomerAccessPermissionFeature
64
            new AgentAccessCustomerSecuredPatternRulePlugin(),
65
        ];
66
    }
67
68
    protected function getAccessTokenAuthenticationHandlerPlugin(): AccessTokenAuthenticationHandlerPluginInterface
69
    {
70
        return new CompanyUserAccessTokenAuthenticationHandlerPlugin();
71
    }
72
}
73