mirror of
https://github.com/laravel/valet.git
synced 2026-02-06 00:40:06 +01:00
Apply fixes from StyleCI
This commit is contained in:
@@ -43,7 +43,7 @@ public static function domainFromSiteName(string $siteName): string
|
|||||||
public static function show404()
|
public static function show404()
|
||||||
{
|
{
|
||||||
http_response_code(404);
|
http_response_code(404);
|
||||||
require __DIR__ . '/cli/templates/404.html';
|
require __DIR__.'/cli/templates/404.html';
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -56,9 +56,9 @@ public static function show404()
|
|||||||
public static function showDirectoryListing(string $valetSitePath, string $uri)
|
public static function showDirectoryListing(string $valetSitePath, string $uri)
|
||||||
{
|
{
|
||||||
$is_root = ($uri == '/');
|
$is_root = ($uri == '/');
|
||||||
$directory = ($is_root) ? $valetSitePath : $valetSitePath . $uri;
|
$directory = ($is_root) ? $valetSitePath : $valetSitePath.$uri;
|
||||||
|
|
||||||
if (!file_exists($directory)) {
|
if (! file_exists($directory)) {
|
||||||
static::show404();
|
static::show404();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
use Illuminate\Container\Container;
|
use Illuminate\Container\Container;
|
||||||
use Valet\Server;
|
use Valet\Server;
|
||||||
|
|
||||||
use function Valet\user;
|
use function Valet\user;
|
||||||
|
|
||||||
class ServerTest extends Yoast\PHPUnitPolyfills\TestCases\TestCase
|
class ServerTest extends Yoast\PHPUnitPolyfills\TestCases\TestCase
|
||||||
@@ -65,7 +64,7 @@ public function test_it_gets_site_path_from_site_name()
|
|||||||
|
|
||||||
$realPath = __DIR__.'/files/sites/tighten';
|
$realPath = __DIR__.'/files/sites/tighten';
|
||||||
$this->assertEquals($realPath, $server->sitePath('tighten'));
|
$this->assertEquals($realPath, $server->sitePath('tighten'));
|
||||||
$realPath = __DIR__ . '/files/sites/tighten';
|
$realPath = __DIR__.'/files/sites/tighten';
|
||||||
$this->assertEquals($realPath, $server->sitePath('subdomain.tighten'));
|
$this->assertEquals($realPath, $server->sitePath('subdomain.tighten'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user