mirror of
https://github.com/laravel/valet.git
synced 2026-02-04 16:10:08 +01:00
Fix code styling
This commit is contained in:
committed by
github-actions[bot]
parent
92c135e2dd
commit
f37a474700
@@ -34,7 +34,7 @@ public function isStaticFile(string $sitePath, string $siteName, string $uri)/*:
|
|||||||
$route = parse_url(substr($uri, 1))['path'];
|
$route = parse_url(substr($uri, 1))['path'];
|
||||||
|
|
||||||
$pub = '';
|
$pub = '';
|
||||||
if ('developer' === $this->mageMode) {
|
if ($this->mageMode === 'developer') {
|
||||||
$pub = 'pub/';
|
$pub = 'pub/';
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -43,7 +43,7 @@ public function isStaticFile(string $sitePath, string $siteName, string $uri)/*:
|
|||||||
}
|
}
|
||||||
|
|
||||||
$magentoPackagePubDir = $sitePath;
|
$magentoPackagePubDir = $sitePath;
|
||||||
if ('developer' !== $this->mageMode) {
|
if ($this->mageMode !== 'developer') {
|
||||||
$magentoPackagePubDir .= '/pub';
|
$magentoPackagePubDir .= '/pub';
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -82,7 +82,7 @@ private function handleForVersions($route): string
|
|||||||
*/
|
*/
|
||||||
private function checkMageMode($sitePath): void
|
private function checkMageMode($sitePath): void
|
||||||
{
|
{
|
||||||
if (null !== $this->mageMode) {
|
if ($this->mageMode !== null) {
|
||||||
// We have already figure out mode, no need to check it again
|
// We have already figure out mode, no need to check it again
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -131,7 +131,7 @@ public function frontControllerPath(string $sitePath, string $siteName, string $
|
|||||||
{
|
{
|
||||||
$this->checkMageMode($sitePath);
|
$this->checkMageMode($sitePath);
|
||||||
|
|
||||||
if ('developer' === $this->mageMode) {
|
if ($this->mageMode === 'developer') {
|
||||||
$_SERVER['DOCUMENT_ROOT'] = $sitePath;
|
$_SERVER['DOCUMENT_ROOT'] = $sitePath;
|
||||||
|
|
||||||
return $sitePath.'/index.php';
|
return $sitePath.'/index.php';
|
||||||
|
|||||||
@@ -224,7 +224,7 @@ public function useVersion(string $version, bool $force = false): ?string
|
|||||||
$version = $this->validateRequestedVersion($version);
|
$version = $this->validateRequestedVersion($version);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if ($this->brew->linkedPhp() === $version && ! $force) {
|
if ($version === $this->brew->linkedPhp() && ! $force) {
|
||||||
output(sprintf('<info>Valet is already using version: <comment>%s</comment>.</info> To re-link and re-configure use the --force parameter.'.PHP_EOL,
|
output(sprintf('<info>Valet is already using version: <comment>%s</comment>.</info> To re-link and re-configure use the --force parameter.'.PHP_EOL,
|
||||||
$version));
|
$version));
|
||||||
exit();
|
exit();
|
||||||
|
|||||||
@@ -168,7 +168,7 @@ public function sitePath(string $siteName): ?string
|
|||||||
|
|
||||||
$dirs = [];
|
$dirs = [];
|
||||||
|
|
||||||
while (false !== ($file = readdir($handle))) {
|
while (($file = readdir($handle)) !== false) {
|
||||||
if (is_dir($path.'/'.$file) && ! in_array($file, ['.', '..'])) {
|
if (is_dir($path.'/'.$file) && ! in_array($file, ['.', '..'])) {
|
||||||
$dirs[] = $file;
|
$dirs[] = $file;
|
||||||
}
|
}
|
||||||
@@ -178,12 +178,12 @@ public function sitePath(string $siteName): ?string
|
|||||||
|
|
||||||
// Note: strtolower used below because Nginx only tells us lowercase names
|
// Note: strtolower used below because Nginx only tells us lowercase names
|
||||||
foreach ($dirs as $dir) {
|
foreach ($dirs as $dir) {
|
||||||
if (strtolower($dir) === $siteName) {
|
if ($siteName === strtolower($dir)) {
|
||||||
// early return when exact match for linked subdomain
|
// early return when exact match for linked subdomain
|
||||||
return $path.'/'.$dir;
|
return $path.'/'.$dir;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strtolower($dir) === $domain) {
|
if ($domain === strtolower($dir)) {
|
||||||
// no early return here because the foreach may still have some subdomains to process with higher priority
|
// no early return here because the foreach may still have some subdomains to process with higher priority
|
||||||
$valetSitePath = $path.'/'.$dir;
|
$valetSitePath = $path.'/'.$dir;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ private function getLinkNameByCurrentDir(): ?string
|
|||||||
public function host(string $path): ?string
|
public function host(string $path): ?string
|
||||||
{
|
{
|
||||||
foreach ($this->files->scandir($this->sitesPath()) as $link) {
|
foreach ($this->files->scandir($this->sitesPath()) as $link) {
|
||||||
if (realpath($this->sitesPath($link)) === $path) {
|
if ($path === realpath($this->sitesPath($link))) {
|
||||||
return $link;
|
return $link;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user