1
0
mirror of https://github.com/nicoverbruggen/phpmon.git synced 2025-08-07 20:10:08 +02:00

👌 Code style fixes (empty line before class closes)

This commit is contained in:
2021-08-31 11:03:55 +02:00
parent c9c15d10f9
commit 9153bb140a
14 changed files with 31 additions and 7 deletions

View File

@ -77,4 +77,5 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserNotificationCenterDele
) -> Bool {
return true
}
}

View File

@ -217,4 +217,5 @@ class Actions {
.trimmingCharacters(in: .whitespacesAndNewlines)
.contains("YES")
}
}

View File

@ -124,4 +124,5 @@ class Startup {
breaking ? failureCallback() : ()
}
}
}

View File

@ -7,11 +7,12 @@
import Cocoa
extension Date
{
extension Date {
func toString() -> String {
let dateFormatter = DateFormatter()
dateFormatter.dateFormat = "yyyy-MM-dd HH:mm:ss"
return dateFormatter.string(from: self)
}
}

View File

@ -33,4 +33,5 @@ extension String {
let end = r.upperBound
return String(self[start ..< end])
}
}

View File

@ -7,17 +7,19 @@
//
import Foundation
import Cocoa
// Adapted from: https://stackoverflow.com/a/46268778
protocol XibLoadable {
static var xibName: String? { get }
static func createFromXib(in bundle: Bundle) -> Self?
}
extension XibLoadable where Self: NSView {
static var xibName: String? {
return String(describing: Self.self)
}
@ -30,4 +32,5 @@ extension XibLoadable where Self: NSView {
let views = Array<Any>(results).filter { $0 is Self }
return views.last as? Self
}
}

View File

@ -8,6 +8,7 @@
import Foundation
struct HomebrewPackage : Decodable {
let name: String
let full_name: String
let aliases: [String]
@ -15,4 +16,5 @@ struct HomebrewPackage : Decodable {
public var version: String {
return aliases.first!.replacingOccurrences(of: "php@", with: "")
}
}

View File

@ -10,6 +10,7 @@ import Foundation
import Cocoa
class HeaderView: NSView, XibLoadable {
@IBOutlet weak var textField: NSTextField!
static func asMenuItem(text: String) -> NSMenuItem {
@ -20,4 +21,5 @@ class HeaderView: NSView, XibLoadable {
item.target = self
return item
}
}

View File

@ -10,6 +10,7 @@ import Foundation
import Cocoa
class StatsView: NSView, XibLoadable {
@IBOutlet weak var titleMemLimit: NSTextField!
@IBOutlet weak var titleMaxPost: NSTextField!
@IBOutlet weak var titleMaxUpload: NSTextField!
@ -31,4 +32,5 @@ class StatsView: NSView, XibLoadable {
item.target = self
return item
}
}

View File

@ -104,4 +104,5 @@ class PhpExtension {
return PhpExtension($0, file: path.path)
}
}
}

View File

@ -169,4 +169,5 @@ class PhpInstallation {
var upload_max_filesize = "???"
var post_max_size = "???"
}
}

View File

@ -14,6 +14,7 @@ struct Keys {
}
class PrefsWC: NSWindowController {
override func windowDidLoad() {
super.windowDidLoad()
}

View File

@ -64,4 +64,5 @@ class Paths {
public static var etcPath: String {
return "\(shared.baseDir.rawValue)/etc"
}
}

View File

@ -21,7 +21,7 @@ class Shell {
// MARK: - Singleton
var shell = "/bin/sh"
var shell: String
init() {
// Determine if we're using macOS Catalina or newer (that support /bin/zsh as default shell)
@ -29,9 +29,14 @@ class Shell {
.init(majorVersion: 10, minorVersion: 15, patchVersion: 0))
// If macOS Mojave is being used, we'll default to /bin/bash
shell = at_least_10_15 ? "/bin/sh" : "/bin/bash"
print(at_least_10_15 ? "Detected recent macOS (> 10.15): defaulting to /bin/sh"
: "Detected older macOS (< 10.15): so defaulting to /bin/bash")
shell = at_least_10_15
? "/bin/sh"
: "/bin/bash"
print(at_least_10_15
? "Detected recent macOS (> 10.15): defaulting to /bin/sh"
: "Detected older macOS (< 10.15): defaulting to /bin/bash"
)
}
/**
@ -78,4 +83,5 @@ class Shell {
public static func fileExists(_ path: String) -> Bool {
return Shell.pipe("if [ -f \(path) ]; then /bin/echo -n \"0\"; fi") == "0"
}
}