Skip to content

Commit 0064c4e

Browse files
authored
Merge pull request #553 from RobvH/fix-regression-with-brew-php-version-format
Fix (really) changes where brew php paths now include @ and semver-st…
2 parents 5d74ad1 + 2afc61c commit 0064c4e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cli/Valet/Brew.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ function hasInstalledPhp()
5252
*/
5353
function supportedPhpVersions()
5454
{
55-
return collect(['php', '[email protected]', '[email protected]', '[email protected]', '[email protected]', 'php72', 'php71', 'php70', 'php56' ]);
55+
return collect(['php', 'php72', 'php71', 'php70', 'php56']);
5656
}
5757

5858
/**
@@ -182,7 +182,7 @@ function linkedPhp()
182182
$resolvedPath = $this->files->readLink('/usr/local/bin/php');
183183

184184
return $this->supportedPhpVersions()->first(function ($version) use ($resolvedPath) {
185-
return strpos($resolvedPath, "/$version/") !== false;
185+
return strpos(preg_replace('/([@|\.])/', '', $resolvedPath), "/$version/") !== false;
186186
}, function () {
187187
throw new DomainException("Unable to determine linked PHP.");
188188
});

0 commit comments

Comments
 (0)