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