Passed
Pull Request — master (#520)
by Alexander
05:42
created

CustomerPageConfig   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 92
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 5
eloc 12
dl 0
loc 92
rs 10
c 1
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A isRememberMeEnabled() 0 3 1
A isDoubleOptInEnabled() 0 3 1
A isLocaleInLoginCheckPath() 0 3 1
A getPasswordValidationMessage() 0 3 1
A getCustomerPasswordPattern() 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
namespace Pyz\Yves\CustomerPage;
9
10
use SprykerShop\Yves\CustomerPage\CustomerPageConfig as SprykerCustomerPageConfig;
11
12
class CustomerPageConfig extends SprykerCustomerPageConfig
13
{
14
    /**
15
     * @var bool
16
     */
17
    protected const CUSTOMER_SECURITY_BLOCKER_ENABLED = true;
18
19
    /**
20
     * @uses \Pyz\Zed\Customer\CustomerConfig::MIN_LENGTH_CUSTOMER_PASSWORD
21
     *
22
     * @var int
23
     */
24
    protected const MIN_LENGTH_CUSTOMER_PASSWORD = 12;
25
26
    /**
27
     * @uses \Pyz\Zed\Customer\CustomerConfig::MAX_LENGTH_CUSTOMER_PASSWORD
28
     *
29
     * @var int
30
     */
31
    protected const MAX_LENGTH_CUSTOMER_PASSWORD = 128;
32
33
    /**
34
     * @var bool
35
     */
36
    protected const IS_ORDER_HISTORY_SEARCH_ENABLED = true;
37
38
    /**
39
     * @var string
40
     */
41
    protected const PASSWORD_VALIDATION_PATTERN = '/^(?=.*[A-Z])(?=.*[a-z])(?=.*\d)(?=.*[!@#$%^&*()\_\-\=\+\[\]\{\}\|;:<>.,\/?\\~])[A-Za-z\d!@#$%^&*()\_\-\=\+\[\]\{\}\|;:<>.,\/?\\~]+$/';
42
43
    /**
44
     * @var string
45
     */
46
    protected const PASSWORD_VALIDATION_MESSAGE = 'global.password.invalid_password';
47
48
    /**
49
     * {@inheritDoc}
50
     *
51
     * @return bool
52
     */
53
    public function isDoubleOptInEnabled(): bool
54
    {
55
        return true;
56
    }
57
58
    /**
59
     * {@inheritDoc}
60
     *
61
     * @api
62
     *
63
     * @deprecated Will be removed without replacement. If the future the locale-specific URL will be used.
64
     *
65
     * @return bool
66
     */
67
    public function isLocaleInLoginCheckPath(): bool
68
    {
69
        return true;
70
    }
71
72
    /**
73
     * @return bool
74
     */
75
    public function isRememberMeEnabled(): bool
76
    {
77
        return false;
78
    }
79
80
    /**
81
     * Specification:
82
     * - Returns the pattern for customer password validation.
83
     *
84
     * @api
85
     *
86
     * @return string
87
     */
88
    public function getCustomerPasswordPattern(): string
89
    {
90
        return static::PASSWORD_VALIDATION_PATTERN;
91
    }
92
93
    /**
94
     * Specification:
95
     * - Returns the message for customer password validation.
96
     *
97
     * @api
98
     *
99
     * @return string
100
     */
101
    public function getPasswordValidationMessage(): string
102
    {
103
        return static::PASSWORD_VALIDATION_MESSAGE;
104
    }
105
}
106