From f13c531bb52b7d0862ec3688316ea7ab3ae96005 Mon Sep 17 00:00:00 2001 From: Alex Tang Date: Sun, 19 May 2019 22:19:45 -0700 Subject: [PATCH] Fix "open static" problem in Swift 5 In Swift 5 "open static" declarations get the error message: "static declarations are implicitly 'final'; use 'public' instead of 'open'". So change made. --- Source/Navajo.swift | 4 ++-- Source/PasswordValidator.swift | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/Navajo.swift b/Source/Navajo.swift index 0ae0417..86aa895 100644 --- a/Source/Navajo.swift +++ b/Source/Navajo.swift @@ -48,7 +48,7 @@ open class Navajo { /// - parameter password: Password string to be calculated /// /// - returns: Level of strength in NJOPasswordStrength - open static func strength(ofPassword password: String) -> PasswordStrength { + public static func strength(ofPassword password: String) -> PasswordStrength { return passwordStrength(forEntropy: entropy(of: password)) } @@ -57,7 +57,7 @@ open class Navajo { /// - parameter strength: NJOPasswordStrength to be converted /// /// - returns: Localized string - open static func localizedString(forStrength strength: PasswordStrength) -> String { + public static func localizedString(forStrength strength: PasswordStrength) -> String { switch strength { case .veryWeak: return NSLocalizedString("NAVAJO_VERY_WEAK", tableName: nil, bundle: Bundle.main, value: "Very Weak", comment: "Navajo - Very weak") diff --git a/Source/PasswordValidator.swift b/Source/PasswordValidator.swift index d9a007e..99fe8db 100644 --- a/Source/PasswordValidator.swift +++ b/Source/PasswordValidator.swift @@ -31,12 +31,12 @@ open class PasswordValidator { open var rules: [PasswordRule] = [] /// PasswordValidator object which checks if the length of password is between 6 and 24. - open static var standard: PasswordValidator { + public static var standard: PasswordValidator { return PasswordValidator(rules: [standardLengthRule]) } /// Length rule having minimum of 6 and maximum of 24. - open static var standardLengthRule: LengthRule { + public static var standardLengthRule: LengthRule { return LengthRule(min: 6, max: 24) }