Skip to content

Commit 05e604e

Browse files
committed
Fix FORCED_PHP_VERSION support
1 parent bd49509 commit 05e604e

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

store.go

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,8 @@ func (s *PHPStore) BestVersionForDir(dir string) (*Version, string, string, erro
7878
// forced version?
7979
if os.Getenv("FORCED_PHP_VERSION") != "" {
8080
minorPHPVersion := strings.Join(strings.Split(os.Getenv("FORCED_PHP_VERSION"), ".")[0:2], ".")
81-
forcedVersion, err := version.NewVersion(minorPHPVersion)
82-
if err == nil {
83-
for _, v := range s.versions {
84-
if v.FullVersion.Equal(forcedVersion) {
85-
return v, "internal forced version", "", nil
86-
}
87-
}
81+
if _, err := version.NewVersion(minorPHPVersion); err == nil {
82+
return s.bestVersion(minorPHPVersion, "internal forced version")
8883
}
8984
}
9085

0 commit comments

Comments
 (0)