From aeeecd6996acc0caad240d080a83e2c0fda348b6 Mon Sep 17 00:00:00 2001 From: Nico Verbruggen Date: Tue, 25 Jan 2022 00:09:36 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=8C=20Suggestions=20should=20also=20ch?= =?UTF-8?q?eck=20all=20constraints?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- phpmon-common/PHP/Homebrew/HomebrewService.swift | 2 +- phpmon/Domain/SiteList/SiteListCell.swift | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/phpmon-common/PHP/Homebrew/HomebrewService.swift b/phpmon-common/PHP/Homebrew/HomebrewService.swift index 1d92861..6c21af4 100644 --- a/phpmon-common/PHP/Homebrew/HomebrewService.swift +++ b/phpmon-common/PHP/Homebrew/HomebrewService.swift @@ -8,7 +8,7 @@ import Foundation -struct HomebrewService: Decodable { +struct HomebrewService: Decodable, Equatable { let name: String let service_name: String let running: Bool diff --git a/phpmon/Domain/SiteList/SiteListCell.swift b/phpmon/Domain/SiteList/SiteListCell.swift index e1ce70a..d525c8a 100644 --- a/phpmon/Domain/SiteList/SiteListCell.swift +++ b/phpmon/Domain/SiteList/SiteListCell.swift @@ -94,7 +94,9 @@ class SiteListCell: NSTableCellView // Determine which installed versions would be ideal to switch to, // but make sure to exclude the currently linked version - PhpEnv.shared.validVersions(for: site.composerPhp).filter({ version in + site.composerPhp.split(separator: "|").flatMap { string in + return PhpEnv.shared.validVersions(for: string.trimmingCharacters(in: .whitespacesAndNewlines)) + }.filter({ version in version.homebrewVersion != PhpEnv.phpInstall.version.short }).forEach { version in alert.addButton(withTitle: "Switch to PHP \(version.homebrewVersion)")