Code Duplication    Length = 7-10 lines in 5 locations

lib/Support/Validator.php 5 locations

@@ 223-232 (lines=10) @@
220
     * Validates the upper case requirements.
221
     * @return boolean
222
     */
223
    private function validateUpperCase()
224
    {
225
        $occurences = preg_match_all(self::REGEX_UPPER_CASE, $this->configuration->checkString());
226
227
        if ($occurences >= $this->configuration->rules()->get(Plexity::RULE_UPPER)) {
228
            return true;
229
        }
230
231
        return false;
232
    }
233
234
    /**
235
     * Validates the lower case requirements.
@@ 238-247 (lines=10) @@
235
     * Validates the lower case requirements.
236
     * @return boolean
237
     */
238
    private function validateLowerCase()
239
    {
240
        $occurrences = preg_match_all(self::REGEX_LOWER_CASE, $this->configuration->checkString());
241
242
        if ($occurrences >= $this->configuration->rules()->get(Plexity::RULE_LOWER)) {
243
            return true;
244
        }
245
246
        return false;
247
    }
248
249
    /**
250
     * Validates the special character requirements.
@@ 279-285 (lines=7) @@
276
     * Validates the minimum string length requirements.
277
     * @return boolean
278
     */
279
    private function validateLengthMin()
280
    {
281
        if (strlen($this->configuration->checkString()) >= $this->configuration->rules()->get(Plexity::RULE_LENGTH_MIN)) {
282
            return true;
283
        }
284
        return false;
285
    }
286
287
    /**
288
     * Validates the maximum string length requirements.
@@ 291-297 (lines=7) @@
288
     * Validates the maximum string length requirements.
289
     * @return boolean
290
     */
291
    private function validateLengthMax()
292
    {
293
        if (strlen($this->configuration->checkString()) <= $this->configuration->rules()->get(Plexity::RULE_LENGTH_MAX)) {
294
            return true;
295
        }
296
        return false;
297
    }
298
299
    /**
300
     * Validates the not_in requirements against a simple array.
@@ 303-310 (lines=8) @@
300
     * Validates the not_in requirements against a simple array.
301
     * @return boolean
302
     */
303
    private function validateNotInArray()
304
    {
305
        if (in_array($this->configuration->checkString(),
306
            (array)$this->configuration->rules()->get(Plexity::RULE_NOT_IN))) {
307
            return false;
308
        }
309
        return true;
310
    }
311
312
    /**
313
     * Validates the not_in requirements against an implementation of PasswordHistoryInterface.