1
0
mirror of https://github.com/laravel/valet.git synced 2026-02-04 16:10:08 +01:00

StyleCI Patch

This commit is contained in:
NasirNobin
2022-03-24 05:17:13 +06:00
parent 6d3d191f44
commit 23aebbe1d9
2 changed files with 14 additions and 16 deletions

View File

@@ -304,18 +304,18 @@ public function getPhpExecutablePath($phpVersion = null)
}
// Check the `/opt/homebrew/opt/php71/bin/php` location for older installations
$phpVersion = str_replace(['@', '.'], '' , $phpVersion); // php@8.1 to php81
$phpVersion = str_replace(['@', '.'], '', $phpVersion); // php@8.1 to php81
if ($this->files->exists(BREW_PREFIX."/opt/{$phpVersion}/bin/php")) {
return BREW_PREFIX."/opt/{$phpVersion}/bin/php";
}
// Check if the default PHP is the version we are looking for
if ($this->files->isLink(BREW_PREFIX."/opt/php")) {
$resolvedPath = $this->files->readLink(BREW_PREFIX."/opt/php");
if ($this->files->isLink(BREW_PREFIX.'/opt/php')) {
$resolvedPath = $this->files->readLink(BREW_PREFIX.'/opt/php');
$matches = $this->parsePhpPath($resolvedPath);
$resolvedPhpVersion = $matches[3] ?: $matches[2];
if ($this->isPhpVersionsEqual($resolvedPhpVersion, $phpVersion)) {
return BREW_PREFIX."/opt/php/bin/php";
return BREW_PREFIX.'/opt/php/bin/php';
}
}
@@ -489,10 +489,9 @@ function ($exitCode, $errorOutput) {
}
/**
* Parse homebrew PHP Path
* Parse homebrew PHP Path.
*
* @param string $resolvedPath
*
* @return mixed
*/
public function parsePhpPath($resolvedPath)
@@ -510,11 +509,10 @@ public function parsePhpPath($resolvedPath)
}
/**
* Check if two PHP versions are equal
*
* @param string $resolvedPhpVersion
* @param string $version
* Check if two PHP versions are equal.
*
* @param string $resolvedPhpVersion
* @param string $version
* @return bool
*/
public function isPhpVersionsEqual($resolvedPhpVersion, $version)