diff --git a/config/trailing-slash.php b/config/trailing-slash.php index bd438a8..bd97a19 100644 --- a/config/trailing-slash.php +++ b/config/trailing-slash.php @@ -10,6 +10,6 @@ // Execute middleware only on these methods 'methods' => [ - 'GET', 'HEAD', 'OPTIONS' + 'GET', 'HEAD', 'OPTIONS', ], ]; diff --git a/src/Middleware/EnsureUrlsWithTrailingSlash.php b/src/Middleware/EnsureUrlsWithTrailingSlash.php index ba2c385..86e1b16 100644 --- a/src/Middleware/EnsureUrlsWithTrailingSlash.php +++ b/src/Middleware/EnsureUrlsWithTrailingSlash.php @@ -8,7 +8,7 @@ class EnsureUrlsWithTrailingSlash extends TrailingSlashMiddleware { public function handle($request, Closure $next) { - if(! $this->shouldHandle($request, shouldHaveTrailingSlash: true)) { + if (! $this->shouldHandle($request, shouldHaveTrailingSlash: true)) { return $next($request); } diff --git a/src/Middleware/EnsureUrlsWithoutTrailingSlash.php b/src/Middleware/EnsureUrlsWithoutTrailingSlash.php index a33b7b4..532e06c 100644 --- a/src/Middleware/EnsureUrlsWithoutTrailingSlash.php +++ b/src/Middleware/EnsureUrlsWithoutTrailingSlash.php @@ -8,7 +8,7 @@ class EnsureUrlsWithoutTrailingSlash extends TrailingSlashMiddleware { public function handle($request, Closure $next) { - if(! $this->shouldHandle($request, shouldHaveTrailingSlash: false)) { + if (! $this->shouldHandle($request, shouldHaveTrailingSlash: false)) { return $next($request); } diff --git a/src/Middleware/TrailingSlashMiddleware.php b/src/Middleware/TrailingSlashMiddleware.php index fcb3a15..514dc1f 100644 --- a/src/Middleware/TrailingSlashMiddleware.php +++ b/src/Middleware/TrailingSlashMiddleware.php @@ -2,7 +2,6 @@ namespace Vormkracht10\TrailingSlash\Middleware; -use Closure; use Illuminate\Http\Request; class TrailingSlashMiddleware @@ -15,7 +14,7 @@ public function shouldHandle(Request $request, $shouldHaveTrailingSlash = true) return false; } - if($this->getParsedUrl($request)['path'] === '/') { + if ($this->getParsedUrl($request)['path'] === '/') { return false; } @@ -50,7 +49,7 @@ public function shouldHandle(Request $request, $shouldHaveTrailingSlash = true) public function getParsedUrl(Request $request) { - if($this->parsedUrl) { + if ($this->parsedUrl) { return $this->parsedUrl; }