Code Duplication    Length = 8-8 lines in 6 locations

lib/Support/Validator.php 6 locations

@@ 121-128 (lines=8) @@
118
     * @return void
119
     * @throws ValidationException
120
     */
121
    public function checkMinimumLength()
122
    {
123
        if ($this->configuration->rules()->get(Plexity::RULE_LENGTH_MIN) > 0) {
124
            if (!$this->validateLengthMin()) {
125
                throw new ValidationException('The length does not meet the minimum length requirements.');
126
            }
127
        }
128
    }
129
130
    /**
131
     * Checks the minimum maximum length requirement.
@@ 135-142 (lines=8) @@
132
     * @return void
133
     * @throws ValidationException
134
     */
135
    public function checkMaximumLength()
136
    {
137
        if ($this->configuration->rules()->get(Plexity::RULE_LENGTH_MAX) > 0) {
138
            if (!$this->validateLengthMax()) {
139
                throw new ValidationException('The length exceeds the maximum length requirements.');
140
            }
141
        }
142
    }
143
144
    /**
145
     * Checks the lowercase character(s) requirement.
@@ 149-156 (lines=8) @@
146
     * @return void
147
     * @throws ValidationException
148
     */
149
    public function checkLowerCase()
150
    {
151
        if ($this->configuration->rules()->get(Plexity::RULE_LOWER) > 0) {
152
            if (!$this->validateLowerCase()) {
153
                throw new ValidationException('The string failed to meet the lower case requirements.');
154
            }
155
        }
156
    }
157
158
    /**
159
     * Checks the upper case character(s) requirement.
@@ 163-170 (lines=8) @@
160
     * @return void
161
     * @throws ValidationException
162
     */
163
    public function checkUpperCase()
164
    {
165
        if ($this->configuration->rules()->get(Plexity::RULE_UPPER) > 0) {
166
            if (!$this->validateUpperCase()) {
167
                throw new ValidationException('The string failed to meet the upper case requirements.');
168
            }
169
        }
170
    }
171
172
    /**
173
     * Checks the numeric character(s) requirement.
@@ 177-184 (lines=8) @@
174
     * @return void
175
     * @throws ValidationException
176
     */
177
    public function checkNumericCharacters()
178
    {
179
        if ($this->configuration->rules()->get(Plexity::RULE_NUMERIC) > 0) {
180
            if (!$this->validateNumericCharacters()) {
181
                throw new ValidationException('The string failed to meet the numeric character requirements.');
182
            }
183
        }
184
    }
185
186
    /**
187
     * Checks the special character(s) requirement.
@@ 191-198 (lines=8) @@
188
     * @return void
189
     * @throws ValidationException
190
     */
191
    public function checkSpecialCharacters()
192
    {
193
        if ($this->configuration->rules()->get(Plexity::RULE_SPECIAL) > 0) {
194
            if (!$this->validateSpecialCharacters()) {
195
                throw new ValidationException('The string failed to meet the special character requirements.');
196
            }
197
        }
198
    }
199
200
    /**
201
     * Validates if a string is not in a array (password history database).