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

🐛 Fixes full PHP version (#142)

This commit is contained in:
2022-02-20 13:48:37 +01:00
parent e3ae878cae
commit 6b3c562af2
2 changed files with 7 additions and 1 deletions

View File

@ -96,6 +96,12 @@ public struct PhpVersionNumber: Equatable {
let minor: Int
let patch: Int?
public func toString() -> String {
return self.patch == nil
? "\(major).\(minor)"
: "\(major).\(minor).\(patch!)"
}
public func patch(_ strictFallback: Bool = true, _ constraint: PhpVersionNumber? = nil) -> Int {
return patch ?? (strictFallback ? 0 : constraint?.patch ?? 999)
}