public static function create($password): string
    {
        if (!$password) {
            throw new \RuntimeException('Password hashing failed: no password provided.');
        }

        $hash = password_hash($password, PASSWORD_DEFAULT);

        if (!$hash) {
            throw new \RuntimeException('Password hashing failed: internal error.');
        }

        return $hash;
    }
public static function create($password): string
    {
        if (!$password) {
            throw new \RuntimeException('Password hashing failed: no password provided.');
        }

        $hash = password_hash($password, PASSWORD_DEFAULT);

        if (!$hash) {
            throw new \RuntimeException('Password hashing failed: internal error.');
        }

        return $hash;
    }
public static function create ( $ password ) : string { if ( ! $ password ) { throw new \ RuntimeException ( 'Password hashing failed: no password provided.' ) ; } $ hash = password_hash ( $ password , PASSWORD_DEFAULT ) ; if ( ! $ hash ) { throw new \ RuntimeException ( 'Password hashing failed: internal error.' ) ; } return $ hash ; }
Create password hash from plaintext password.

@param string $password Plaintext password.

@throws \RuntimeException
@return string
Create password hash from plaintext password .