mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/izyim.git
synced 2026-08-19 20:44:03 +00:00
8a28eb1790
This reverts merge request !5
29 lines
651 B
PHP
29 lines
651 B
PHP
<?php
|
|
|
|
namespace App\Traits;
|
|
|
|
trait DeterminesIfUserPasswordMatchesRequirements {
|
|
/**
|
|
* @param string $password
|
|
*
|
|
* @return bool
|
|
*/
|
|
private function doesPasswordMeetRequirements(string $password): bool {
|
|
$matches = [];
|
|
|
|
// preg_match('/^.*(?=.{3,})(?=.*[a-z])(?=.*[A-Z])(?=.*[\d]).*$/', $password, $matches);
|
|
|
|
// return count($matches) > 0;
|
|
return true;
|
|
}
|
|
|
|
/**
|
|
* @param string $password
|
|
*
|
|
* @return bool
|
|
*/
|
|
private function checkPasswordAndThrowIfInvalid(string $password): bool {
|
|
return $this->doesPasswordMeetRequirements($password) === true;
|
|
}
|
|
}
|