1
0
mirror of https://github.com/nicoverbruggen/phpmon.git synced 2025-11-07 21:20:07 +01:00

Fix tests

This commit is contained in:
2022-03-17 23:32:13 +01:00
parent 15182ea15a
commit 1d6cfd419e
3 changed files with 12 additions and 6 deletions

View File

@@ -117,10 +117,14 @@ class PhpEnv {
/**
Extracts valid PHP versions from an array of strings.
This array of strings is usually retrieved from `grep`.
If `generateHelpers` is set to true, after detecting
all versions, helper scripts are generated as well.
*/
public func extractPhpVersions(
from versions: [String],
checkBinaries: Bool = true
checkBinaries: Bool = true,
generateHelpers: Bool = true
) -> [String] {
var output : [String] = []
@@ -146,15 +150,15 @@ class PhpEnv {
}
}
writeHelpers(with: output)
if generateHelpers {
versions.forEach { PhpHelper.generate(for: $0) }
}
return output
}
private func writeHelpers(with versions: [String]) {
for version in versions {
PhpHelper.generate(for: version)
}
}
public func validVersions(for constraint: String) -> [PhpVersionNumber] {