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