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

Apply fixes from StyleCI

This commit is contained in:
Taylor Otwell
2021-12-06 10:40:37 +00:00
committed by StyleCI Bot
parent 3a5d12e24d
commit 101abeae0e
35 changed files with 580 additions and 536 deletions

View File

@@ -69,26 +69,26 @@ public function frontControllerPath($sitePath, $siteName, $uri)
$sitePathPrefix = ($isAboveWebroot) ? $sitePath.'/public' : $sitePath;
if ($locale = $this->getUriLocale($uri)) {
if ($this->isActualFile($localeIndexPath = $sitePathPrefix . '/' . $locale . '/index.php')) {
if ($this->isActualFile($localeIndexPath = $sitePathPrefix.'/'.$locale.'/index.php')) {
// Force trailing slashes on locale roots.
if ($uri === '/' . $locale) {
header('Location: ' . $uri . '/');
die;
if ($uri === '/'.$locale) {
header('Location: '.$uri.'/');
exit;
}
$indexPath = $localeIndexPath;
$scriptName = '/' . $locale . '/index.php';
$scriptName = '/'.$locale.'/index.php';
}
}
$_SERVER['SCRIPT_NAME'] = $scriptName;
$_SERVER['SCRIPT_FILENAME'] = $sitePathPrefix . $scriptName;
$_SERVER['SCRIPT_FILENAME'] = $sitePathPrefix.$scriptName;
return $indexPath;
}
/**
* Get the locale from this URI
* Get the locale from this URI.
*
* @param string $uri
* @return string|null
@@ -106,7 +106,7 @@ public function getUriLocale($uri)
}
/**
* Get the list of possible locales used in the first segment of a URI
* Get the list of possible locales used in the first segment of a URI.
*
* @return array
*/
@@ -131,9 +131,9 @@ public function getLocales()
}
/**
* Get the path to a statically cached page
* Get the path to a statically cached page.
*
* @param string $sitePath
* @param string $sitePath
* @return string
*/
protected function getStaticPath($sitePath)
@@ -141,6 +141,6 @@ protected function getStaticPath($sitePath)
$parts = parse_url($_SERVER['REQUEST_URI']);
$query = isset($parts['query']) ? $parts['query'] : '';
return $sitePath . '/static' . $parts['path'] . '_' . $query . '.html';
return $sitePath.'/static'.$parts['path'].'_'.$query.'.html';
}
}