mirror of
https://github.com/nicoverbruggen/phpmon.git
synced 2025-08-07 03:50:08 +02:00
♻️ Cleanup
This commit is contained in:
@ -25,35 +25,3 @@ protocol DomainListable {
|
||||
func getListableUrl() -> URL?
|
||||
|
||||
}
|
||||
|
||||
extension ValetSite {
|
||||
|
||||
func getListableName() -> String {
|
||||
return self.name
|
||||
}
|
||||
|
||||
func getListableSecured() -> Bool {
|
||||
return self.secured
|
||||
}
|
||||
|
||||
func getListableAbsolutePath() -> String {
|
||||
return self.absolutePath
|
||||
}
|
||||
|
||||
func getListablePhpVersion() -> String {
|
||||
return self.servingPhpVersion
|
||||
}
|
||||
|
||||
func getListableKind() -> String {
|
||||
return (self.aliasPath == nil) ? "linked" : "parked"
|
||||
}
|
||||
|
||||
func getListableType() -> String {
|
||||
return self.driver ?? "ZZZ"
|
||||
}
|
||||
|
||||
func getListableUrl() -> URL? {
|
||||
return URL(string: "\(self.secured ? "https://" : "http://")\(self.name).\(Valet.shared.config.tld)")
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -19,23 +19,3 @@ protocol DomainInteractable {
|
||||
func unlink() async throws
|
||||
|
||||
}
|
||||
|
||||
extension ValetSite: DomainInteractable {
|
||||
|
||||
func secure() async throws {
|
||||
try await ValetInteractor.secure(site: self)
|
||||
}
|
||||
|
||||
func unsecure() async throws {
|
||||
try await ValetInteractor.unsecure(site: self)
|
||||
}
|
||||
|
||||
func isolate(version: PhpVersionNumber) async throws {
|
||||
try await ValetInteractor.isolate(site: self, version: version)
|
||||
}
|
||||
|
||||
func unlink() async throws {
|
||||
try await ValetInteractor.unlink(site: self)
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
class ValetSite: DomainListable {
|
||||
class ValetSite: DomainListable, DomainInteractable {
|
||||
|
||||
/// Name of the site. Does not include the TLD.
|
||||
var name: String
|
||||
@ -232,4 +232,52 @@ class ValetSite: DomainListable {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// MARK: DomainListable
|
||||
|
||||
func getListableName() -> String {
|
||||
return self.name
|
||||
}
|
||||
|
||||
func getListableSecured() -> Bool {
|
||||
return self.secured
|
||||
}
|
||||
|
||||
func getListableAbsolutePath() -> String {
|
||||
return self.absolutePath
|
||||
}
|
||||
|
||||
func getListablePhpVersion() -> String {
|
||||
return self.servingPhpVersion
|
||||
}
|
||||
|
||||
func getListableKind() -> String {
|
||||
return (self.aliasPath == nil) ? "linked" : "parked"
|
||||
}
|
||||
|
||||
func getListableType() -> String {
|
||||
return self.driver ?? "ZZZ"
|
||||
}
|
||||
|
||||
func getListableUrl() -> URL? {
|
||||
return URL(string: "\(self.secured ? "https://" : "http://")\(self.name).\(Valet.shared.config.tld)")
|
||||
}
|
||||
|
||||
// MARK: DomainInteractable
|
||||
|
||||
func secure() async throws {
|
||||
try await ValetInteractor.secure(site: self)
|
||||
}
|
||||
|
||||
func unsecure() async throws {
|
||||
try await ValetInteractor.unsecure(site: self)
|
||||
}
|
||||
|
||||
func isolate(version: PhpVersionNumber) async throws {
|
||||
try await ValetInteractor.isolate(site: self, version: version)
|
||||
}
|
||||
|
||||
func unlink() async throws {
|
||||
try await ValetInteractor.unlink(site: self)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user