Files
izyim/app/Traits/DeterminesIfUserPasswordMatchesRequirements.php
omair saleh 8a28eb1790 Revert "Merge branch 'dashboardReport' into 'master'"
This reverts merge request !5
2019-03-19 09:57:38 +00:00

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;
}
}