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'];
|
||||
|
||||
$pub = '';
|
||||
if ('developer' === $this->mageMode) {
|
||||
if ($this->mageMode === 'developer') {
|
||||
$pub = 'pub/';
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ public function isStaticFile(string $sitePath, string $siteName, string $uri)/*:
|
||||
}
|
||||
|
||||
$magentoPackagePubDir = $sitePath;
|
||||
if ('developer' !== $this->mageMode) {
|
||||
if ($this->mageMode !== 'developer') {
|
||||
$magentoPackagePubDir .= '/pub';
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ private function handleForVersions($route): string
|
||||
*/
|
||||
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
|
||||
return;
|
||||
}
|
||||
@@ -131,7 +131,7 @@ public function frontControllerPath(string $sitePath, string $siteName, string $
|
||||
{
|
||||
$this->checkMageMode($sitePath);
|
||||
|
||||
if ('developer' === $this->mageMode) {
|
||||
if ($this->mageMode === 'developer') {
|
||||
$_SERVER['DOCUMENT_ROOT'] = $sitePath;
|
||||
|
||||
return $sitePath.'/index.php';
|
||||
|
||||
@@ -224,7 +224,7 @@ public function useVersion(string $version, bool $force = false): ?string
|
||||
$version = $this->validateRequestedVersion($version);
|
||||
|
||||
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,
|
||||
$version));
|
||||
exit();
|
||||
|
||||
@@ -168,7 +168,7 @@ public function sitePath(string $siteName): ?string
|
||||
|
||||
$dirs = [];
|
||||
|
||||
while (false !== ($file = readdir($handle))) {
|
||||
while (($file = readdir($handle)) !== false) {
|
||||
if (is_dir($path.'/'.$file) && ! in_array($file, ['.', '..'])) {
|
||||
$dirs[] = $file;
|
||||
}
|
||||
@@ -178,12 +178,12 @@ public function sitePath(string $siteName): ?string
|
||||
|
||||
// Note: strtolower used below because Nginx only tells us lowercase names
|
||||
foreach ($dirs as $dir) {
|
||||
if (strtolower($dir) === $siteName) {
|
||||
if ($siteName === strtolower($dir)) {
|
||||
// early return when exact match for linked subdomain
|
||||
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
|
||||
$valetSitePath = $path.'/'.$dir;
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ private function getLinkNameByCurrentDir(): ?string
|
||||
public function host(string $path): ?string
|
||||
{
|
||||
foreach ($this->files->scandir($this->sitesPath()) as $link) {
|
||||
if (realpath($this->sitesPath($link)) === $path) {
|
||||
if ($path === realpath($this->sitesPath($link))) {
|
||||
return $link;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user