Bolt\EventListener\StorageEventListener::getValidHash PHP Method

getValidHash() private method

Return a valid hash for a password, of if the password is already hashed just return as is.
private getValidHash ( string $password ) : string
$password string
return string
    private function getValidHash($password)
    {
        if (Password\Blowfish::detect($password)) {
            return $password;
        }
        if (Password\PHPASS::detect($password)) {
            return $password;
        }
        if (strlen($password) < 6) {
            throw new AccessControlException('Can not save a password with a length shorter than 6 characters!');
        }
        return $this->passwordFactory->createHash($password, '$2y$');
    }