mirror of
https://github.com/laravel/valet.git
synced 2026-02-05 08:30:07 +01:00
Fix code styling
This commit is contained in:
committed by
github-actions[bot]
parent
b5e4228356
commit
cbb571f7ac
@@ -243,12 +243,12 @@ public function readLink(string $path): string
|
||||
public function removeBrokenLinksAt(string $path): void
|
||||
{
|
||||
collect($this->scandir($path))
|
||||
->filter(function ($file) use ($path) {
|
||||
return $this->isBrokenLink($path.'/'.$file);
|
||||
})
|
||||
->each(function ($file) use ($path) {
|
||||
$this->unlink($path.'/'.$file);
|
||||
});
|
||||
->filter(function ($file) use ($path) {
|
||||
return $this->isBrokenLink($path.'/'.$file);
|
||||
})
|
||||
->each(function ($file) use ($path) {
|
||||
$this->unlink($path.'/'.$file);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -265,9 +265,9 @@ public function isBrokenLink(string $path): bool
|
||||
public function scandir(string $path): array
|
||||
{
|
||||
return collect(scandir($path))
|
||||
->reject(function ($file) {
|
||||
return in_array($file, ['.', '..']);
|
||||
})->values()->all();
|
||||
->reject(function ($file) {
|
||||
return in_array($file, ['.', '..']);
|
||||
})->values()->all();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -10,7 +10,7 @@ class Nginx
|
||||
const NGINX_CONF = BREW_PREFIX.'/etc/nginx/nginx.conf';
|
||||
|
||||
public function __construct(public Brew $brew, public CommandLine $cli, public Filesystem $files,
|
||||
public Configuration $configuration, public Site $site)
|
||||
public Configuration $configuration, public Site $site)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -132,32 +132,32 @@ public function proxies(): Collection
|
||||
}
|
||||
|
||||
$proxies = collect($this->files->scandir($dir))
|
||||
->filter(function ($site, $key) use ($tld) {
|
||||
// keep sites that match our TLD
|
||||
return ends_with($site, '.'.$tld);
|
||||
})->map(function ($site, $key) use ($tld) {
|
||||
// remove the TLD suffix for consistency
|
||||
return str_replace('.'.$tld, '', $site);
|
||||
})->reject(function ($site, $key) use ($links) {
|
||||
return $links->has($site);
|
||||
})->mapWithKeys(function ($site) {
|
||||
$host = $this->getProxyHostForSite($site) ?: '(other)';
|
||||
->filter(function ($site, $key) use ($tld) {
|
||||
// keep sites that match our TLD
|
||||
return ends_with($site, '.'.$tld);
|
||||
})->map(function ($site, $key) use ($tld) {
|
||||
// remove the TLD suffix for consistency
|
||||
return str_replace('.'.$tld, '', $site);
|
||||
})->reject(function ($site, $key) use ($links) {
|
||||
return $links->has($site);
|
||||
})->mapWithKeys(function ($site) {
|
||||
$host = $this->getProxyHostForSite($site) ?: '(other)';
|
||||
|
||||
return [$site => $host];
|
||||
})->reject(function ($host, $site) {
|
||||
// If proxy host is null, it may be just a normal SSL stub, or something else; either way we exclude it from the list
|
||||
return $host === '(other)';
|
||||
})->map(function ($host, $site) use ($certs, $tld) {
|
||||
$secured = $certs->has($site);
|
||||
$url = ($secured ? 'https' : 'http').'://'.$site.'.'.$tld;
|
||||
return [$site => $host];
|
||||
})->reject(function ($host, $site) {
|
||||
// If proxy host is null, it may be just a normal SSL stub, or something else; either way we exclude it from the list
|
||||
return $host === '(other)';
|
||||
})->map(function ($host, $site) use ($certs, $tld) {
|
||||
$secured = $certs->has($site);
|
||||
$url = ($secured ? 'https' : 'http').'://'.$site.'.'.$tld;
|
||||
|
||||
return [
|
||||
'site' => $site,
|
||||
'secured' => $secured ? ' X' : '',
|
||||
'url' => $url,
|
||||
'path' => $host,
|
||||
];
|
||||
});
|
||||
return [
|
||||
'site' => $site,
|
||||
'secured' => $secured ? ' X' : '',
|
||||
'url' => $url,
|
||||
'path' => $host,
|
||||
];
|
||||
});
|
||||
|
||||
return $proxies;
|
||||
}
|
||||
@@ -428,11 +428,11 @@ public function replaceOldLoopbackWithNew(string $siteConf, string $old, string
|
||||
public function secured(): array
|
||||
{
|
||||
return collect($this->files->scandir($this->certificatesPath()))
|
||||
->filter(function ($file) {
|
||||
return ends_with($file, ['.key', '.csr', '.crt', '.conf']);
|
||||
})->map(function ($file) {
|
||||
return str_replace(['.key', '.csr', '.crt', '.conf'], '', $file);
|
||||
})->unique()->values()->all();
|
||||
->filter(function ($file) {
|
||||
return ends_with($file, ['.key', '.csr', '.crt', '.conf']);
|
||||
})->map(function ($file) {
|
||||
return str_replace(['.key', '.csr', '.crt', '.conf'], '', $file);
|
||||
})->unique()->values()->all();
|
||||
}
|
||||
|
||||
public function isSecured(string $site): bool
|
||||
|
||||
Reference in New Issue
Block a user