From 91d7a4bf446ec0a9d2d43795dc1ef0ee234dd4cb Mon Sep 17 00:00:00 2001 From: Nico Verbruggen Date: Thu, 16 Oct 2025 14:04:53 +0200 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20Cleanup=20phase=201?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Common/Testables/TestableConfiguration.swift | 1 - phpmon/Domain/App/Startup.swift | 9 ++++++--- .../Integrations/Homebrew/BrewDiagnostics.swift | 3 ++- phpmon/Domain/Menu/MainMenu.swift | 2 +- .../PHP Config Editor/Data/BytePhpPreference.swift | 2 +- tests/PHP Monitor.xctestplan | 14 ++++++++++++++ 6 files changed, 24 insertions(+), 7 deletions(-) diff --git a/phpmon/Common/Testables/TestableConfiguration.swift b/phpmon/Common/Testables/TestableConfiguration.swift index 47527e0b..42f08095 100644 --- a/phpmon/Common/Testables/TestableConfiguration.swift +++ b/phpmon/Common/Testables/TestableConfiguration.swift @@ -117,7 +117,6 @@ public struct TestableConfiguration: Codable { // MARK: Interactions - #warning("This method should replace the container's resolved classes with the fake ones.") func apply() { Log.separator() Log.info("USING TESTABLE CONFIGURATION...") diff --git a/phpmon/Domain/App/Startup.swift b/phpmon/Domain/App/Startup.swift index 55a0e2a9..e7121de2 100644 --- a/phpmon/Domain/App/Startup.swift +++ b/phpmon/Domain/App/Startup.swift @@ -119,7 +119,8 @@ class Startup { // ================================================================================= EnvironmentCheck( command: { - return await !App.shared.container.shell.pipe("ls \(App.shared.container.paths.optPath) | grep php").out.contains("php") + return await !App.shared.container.shell + .pipe("ls \(App.shared.container.paths.optPath) | grep php").out.contains("php") }, name: "`ls \(App.shared.container.paths.optPath) | grep php` returned php result", titleText: "startup.errors.php_opt.title".localized, @@ -176,14 +177,16 @@ class Startup { // functioning correctly. Let the user know that they need to run `valet trust`. // ================================================================================= EnvironmentCheck( - command: { return await !App.shared.container.shell.pipe("cat /private/etc/sudoers.d/brew").out.contains(App.shared.container.paths.brew) }, + command: { return await !App.shared.container.shell + .pipe("cat /private/etc/sudoers.d/brew").out.contains(App.shared.container.paths.brew) }, name: "`/private/etc/sudoers.d/brew` contains brew", titleText: "startup.errors.sudoers_brew.title".localized, subtitleText: "startup.errors.sudoers_brew.subtitle".localized, descriptionText: "startup.errors.sudoers_brew.desc".localized ), EnvironmentCheck( - command: { return await !App.shared.container.shell.pipe("cat /private/etc/sudoers.d/valet").out.contains(App.shared.container.paths.valet) }, + command: { return await !App.shared.container.shell + .pipe("cat /private/etc/sudoers.d/valet").out.contains(App.shared.container.paths.valet) }, name: "`/private/etc/sudoers.d/valet` contains valet", titleText: "startup.errors.sudoers_valet.title".localized, subtitleText: "startup.errors.sudoers_valet.subtitle".localized, diff --git a/phpmon/Domain/Integrations/Homebrew/BrewDiagnostics.swift b/phpmon/Domain/Integrations/Homebrew/BrewDiagnostics.swift index 1d527d65..45079a1c 100644 --- a/phpmon/Domain/Integrations/Homebrew/BrewDiagnostics.swift +++ b/phpmon/Domain/Integrations/Homebrew/BrewDiagnostics.swift @@ -59,7 +59,8 @@ class BrewDiagnostics { Determines whether to use the regular `nginx` or `nginx-full` formula. */ public var usesNginxFullFormula: Bool { - guard let destination = try? filesystem.getDestinationOfSymlink("\(container.paths.binPath)/nginx") else { return false } + guard let destination = try? filesystem + .getDestinationOfSymlink("\(container.paths.binPath)/nginx") else { return false } // Verify that the `nginx` binary is symlinked to a directory that includes `nginx-full`. return destination.contains("/nginx-full/") diff --git a/phpmon/Domain/Menu/MainMenu.swift b/phpmon/Domain/Menu/MainMenu.swift index 571854cb..e2517368 100644 --- a/phpmon/Domain/Menu/MainMenu.swift +++ b/phpmon/Domain/Menu/MainMenu.swift @@ -8,7 +8,7 @@ import Cocoa import NVAlert -@MainActor +@MainActor class MainMenu: NSObject, NSWindowDelegate, NSMenuDelegate, PhpSwitcherDelegate { var container: Container { return App.shared.container diff --git a/phpmon/Modules/PHP Config Editor/Data/BytePhpPreference.swift b/phpmon/Modules/PHP Config Editor/Data/BytePhpPreference.swift index b9230116..856c05cc 100644 --- a/phpmon/Modules/PHP Config Editor/Data/BytePhpPreference.swift +++ b/phpmon/Modules/PHP Config Editor/Data/BytePhpPreference.swift @@ -47,7 +47,7 @@ class BytePhpPreference: PhpPreference { self.unit = unit self.value = value } - + super.init(container, key: key) } diff --git a/tests/PHP Monitor.xctestplan b/tests/PHP Monitor.xctestplan index 9820fc03..5c12799f 100644 --- a/tests/PHP Monitor.xctestplan +++ b/tests/PHP Monitor.xctestplan @@ -12,6 +12,20 @@ }, "testTargets" : [ + { + "target" : { + "containerPath" : "container:PHP Monitor.xcodeproj", + "identifier" : "C471E7AC28F9B4940021E251", + "name" : "Feature Tests" + } + }, + { + "target" : { + "containerPath" : "container:PHP Monitor.xcodeproj", + "identifier" : "C471E7BB28F9B90F0021E251", + "name" : "UI Tests" + } + }, { "parallelizable" : false, "target" : {