mirror of
https://github.com/laravel/valet.git
synced 2026-02-04 16:10:08 +01:00
Apply more suggestions from code review
This commit is contained in:
@@ -192,7 +192,7 @@ public function stopRunning()
|
||||
* @param string|null $phpVersion
|
||||
* @return void
|
||||
*/
|
||||
public function maybeStop($phpVersion)
|
||||
public function stopIfUnused($phpVersion)
|
||||
{
|
||||
if (! $phpVersion) {
|
||||
return;
|
||||
@@ -228,9 +228,9 @@ public function useVersion($version, $force = false, $directory = null)
|
||||
}
|
||||
|
||||
if ($version == 'default') { // Remove isolation for this site
|
||||
$customPhpVersion = $this->site->customPhpVersion($site); // Example output: "74"
|
||||
$oldCustomPhpVersion = $this->site->customPhpVersion($site); // Example output: "74"
|
||||
$this->site->removeIsolation($site);
|
||||
$this->maybeStop($customPhpVersion);
|
||||
$this->stopIfUnused($oldCustomPhpVersion);
|
||||
$this->nginx->restart();
|
||||
info(sprintf('The site [%s] is now using the default PHP version.', $site));
|
||||
return;
|
||||
@@ -254,15 +254,15 @@ public function useVersion($version, $force = false, $directory = null)
|
||||
}
|
||||
|
||||
if ($directory) {
|
||||
$customPhpVersion = $this->site->customPhpVersion($site); // Example output: "74"
|
||||
$oldCustomPhpVersion = $this->site->customPhpVersion($site); // Example output: "74"
|
||||
$this->cli->quietly('sudo rm '.VALET_HOME_PATH.'/'.$this->fpmSockName($version));
|
||||
$this->updateConfiguration($version);
|
||||
$this->site->installSiteConfig($site, $this->fpmSockName($version), $version);
|
||||
|
||||
$this->maybeStop($customPhpVersion);
|
||||
$this->stopIfUnused($oldCustomPhpVersion);
|
||||
$this->restart($version);
|
||||
$this->nginx->restart();
|
||||
info(sprintf('The [%s] site is now using %s.', $site, $version));
|
||||
info(sprintf('The site [%s] is now using %s.', $site, $version));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user