1
0
mirror of https://github.com/laravel/valet.git synced 2026-02-05 08:30:07 +01:00

Apply fixes from StyleCI

This commit is contained in:
StyleCI Bot
2022-03-14 04:16:45 +00:00
parent 95aa03977c
commit 9b8c41e3d3
4 changed files with 14 additions and 14 deletions

View File

@@ -179,13 +179,13 @@ public function uninstall()
} }
/** /**
* Return a list of all sites with explicit Nginx configurations * Return a list of all sites with explicit Nginx configurations.
* *
* @return \Illuminate\Support\Collection * @return \Illuminate\Support\Collection
*/ */
public function configuredSites() public function configuredSites()
{ {
return collect($this->files->scandir(VALET_HOME_PATH.'/Nginx')) return collect($this->files->scandir(VALET_HOME_PATH.'/Nginx'))
->reject(function ($file) { ->reject(function ($file) {
return starts_with($file, '.'); return starts_with($file, '.');
}); });

View File

@@ -383,18 +383,18 @@ public function utilizedPhpVersions()
})->unique(); })->unique();
return $this->nginx->configuredSites()->map(function ($file) use ($fpmSockFiles) { return $this->nginx->configuredSites()->map(function ($file) use ($fpmSockFiles) {
$content = $this->files->get(VALET_HOME_PATH.'/Nginx/'.$file); $content = $this->files->get(VALET_HOME_PATH.'/Nginx/'.$file);
// Get the normalized PHP version for this config file, if it's defined // Get the normalized PHP version for this config file, if it's defined
foreach ($fpmSockFiles as $sock) { foreach ($fpmSockFiles as $sock) {
if (strpos($content, $sock) !== false) { if (strpos($content, $sock) !== false) {
// Extract the PHP version number from a custom .sock path; // Extract the PHP version number from a custom .sock path;
// for example, "valet74.sock" will output "php74" // for example, "valet74.sock" will output "php74"
$phpVersion = 'php'.str_replace(['valet', '.sock'], '', $sock); $phpVersion = 'php'.str_replace(['valet', '.sock'], '', $sock);
return $this->normalizePhpVersion($phpVersion); // Example output php@7.4 return $this->normalizePhpVersion($phpVersion); // Example output php@7.4
}
} }
})->merge([$this->brew->getLinkedPhpFormula()])->filter()->unique()->values()->toArray(); }
})->merge([$this->brew->getLinkedPhpFormula()])->filter()->unique()->values()->toArray();
} }
} }

View File

@@ -531,7 +531,7 @@
})->descriptions('Stop customizing the version of PHP used by Valet to serve the current working directory'); })->descriptions('Stop customizing the version of PHP used by Valet to serve the current working directory');
/** /**
* List isolated sites * List isolated sites.
*/ */
$app->command('isolated', function () { $app->command('isolated', function () {
$sites = PhpFpm::isolatedDirectories(); $sites = PhpFpm::isolatedDirectories();

View File

@@ -93,7 +93,7 @@ public function test_it_gets_configured_sites()
$files->shouldReceive('scandir') $files->shouldReceive('scandir')
->once() ->once()
->with(VALET_HOME_PATH . '/Nginx') ->with(VALET_HOME_PATH.'/Nginx')
->andReturn(['.gitkeep', 'isolated-site-71.test', 'isolated-site-72.test', 'isolated-site-73.test']); ->andReturn(['.gitkeep', 'isolated-site-71.test', 'isolated-site-72.test', 'isolated-site-73.test']);
swap(Filesystem::class, $files); swap(Filesystem::class, $files);