diff --git a/phpmon/Common/Core/Constants.swift b/phpmon/Common/Core/Constants.swift index a08b8ed..85c6e2e 100644 --- a/phpmon/Common/Core/Constants.swift +++ b/phpmon/Common/Core/Constants.swift @@ -7,7 +7,7 @@ import Cocoa -class Constants { +struct Constants { /** * The latest PHP version that is considered to be stable at the time of release. @@ -51,8 +51,18 @@ class Constants { "8.2" ] - static let DonationUrlDirect = URL(string: "https://nicoverbruggen.be/sponsor#pay-now")! - static let DonationUrl = URL(string: "https://nicoverbruggen.be/sponsor")! - static let FrequentlyAskedQuestionsUrl = URL(string: "https://github.com/nicoverbruggen/phpmon#%EF%B8%8F-faq--troubleshooting")! + struct Urls { + + static let DonationPayment = URL( + string: "https://nicoverbruggen.be/sponsor#pay-now" + )! + static let DonationPage = URL( + string: "https://nicoverbruggen.be/sponsor" + )! + static let FrequentlyAskedQuestions = URL( + string: "https://github.com/nicoverbruggen/phpmon#%EF%B8%8F-faq--troubleshooting" + )! + + } } diff --git a/phpmon/Domain/Menu/MainMenu+FixMyValet.swift b/phpmon/Domain/Menu/MainMenu+FixMyValet.swift index 9745ade..cf1c532 100644 --- a/phpmon/Domain/Menu/MainMenu+FixMyValet.swift +++ b/phpmon/Domain/Menu/MainMenu+FixMyValet.swift @@ -77,7 +77,7 @@ extension MainMenu { }) .withSecondary(text: "alert.fix_my_valet_done.stay".localized(PhpEnv.brewPhpVersion)) .withTertiary(text: "", action: { alert in - NSWorkspace.shared.open(Constants.FrequentlyAskedQuestionsUrl) + NSWorkspace.shared.open(Constants.Urls.FrequentlyAskedQuestions) }) .show() } diff --git a/phpmon/Domain/Menu/MainMenu.swift b/phpmon/Domain/Menu/MainMenu.swift index baf8165..9f10678 100644 --- a/phpmon/Domain/Menu/MainMenu.swift +++ b/phpmon/Domain/Menu/MainMenu.swift @@ -323,7 +323,7 @@ class MainMenu: NSObject, NSWindowDelegate, NSMenuDelegate, PhpSwitcherDelegate } @objc func openDonate() { - NSWorkspace.shared.open(Constants.DonationUrl) + NSWorkspace.shared.open(Constants.Urls.DonationPage) } @objc func terminateApp() { diff --git a/phpmon/Domain/Preferences/Stats.swift b/phpmon/Domain/Preferences/Stats.swift index 3734137..bc5915e 100644 --- a/phpmon/Domain/Preferences/Stats.swift +++ b/phpmon/Domain/Preferences/Stats.swift @@ -110,12 +110,12 @@ class Stats { .withSecondary(text: "startup.sponsor_encouragement.skip".localized) .withTertiary(text: "", action: { vc in vc.close(with: .alertThirdButtonReturn) - NSWorkspace.shared.open(Constants.DonationUrl) + NSWorkspace.shared.open(Constants.Urls.DonationPage) }).didSelectPrimary() if donate { Log.info("The user is an absolute badass for choosing this option. Thank you.") - NSWorkspace.shared.open(Constants.DonationUrlDirect) + NSWorkspace.shared.open(Constants.Urls.DonationPayment) } UserDefaults.standard.set(true, forKey: InternalStats.didSeeSponsorEncouragement.rawValue)