Skip to content

Commit

Permalink
Fix phpstan errors
Browse files Browse the repository at this point in the history
Signed-off-by: Sam Poyigi <[email protected]>
  • Loading branch information
sampoyigi committed May 18, 2024
1 parent 50d4e1c commit be4a863
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,11 @@ parameters:
count: 1
path: src/Http/Middleware/CheckLocation.php

-
message: "#^Call to an undefined static method Igniter\\\\User\\\\Facades\\\\AdminAuth\\:\\:getUser\\(\\)\\.$#"
count: 1
path: src/Http/Middleware/CheckLocation.php

-
message: "#^Call to an undefined static method Igniter\\\\User\\\\Facades\\\\AdminAuth\\:\\:user\\(\\)\\.$#"
count: 1
Expand All @@ -355,6 +360,11 @@ parameters:
count: 1
path: src/Http/Middleware/CheckLocation.php

-
message: "#^Cannot call method parameter\\(\\) on object\\|string\\.$#"
count: 1
path: src/Http/Middleware/CheckLocation.php

-
message: "#^Cannot call method setParameter\\(\\) on object\\|string\\.$#"
count: 1
Expand Down
2 changes: 1 addition & 1 deletion src/Http/Middleware/CheckLocation.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public function handle(Request $request, Closure $next)
$request->route()->setParameter('location', $location->permalink_slug);
}

if ($request->route()->parameter('location') !== Location::current()->permalink_slug) {
if ($location && $request->route()->parameter('location') !== $location?->permalink_slug) {
return redirect()->to(page_url('home'));
}

Expand Down

0 comments on commit be4a863

Please sign in to comment.