Skip to content

Commit

Permalink
Apply fixes from StyleCI
Browse files Browse the repository at this point in the history
  • Loading branch information
KABBOUCHI authored and StyleCIBot committed Jun 20, 2020
1 parent 96628e6 commit 841dfd0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/Http/Controllers/ImpersonateController.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ public function take(Request $request, $id, $guardName = null)
{
$guardName = $guardName ?? config('nova-impersonate.default_impersonator_guard');

if (method_exists($request->user(), 'canImpersonate') && !$request->user()->canImpersonate()) {
if (method_exists($request->user(), 'canImpersonate') && ! $request->user()->canImpersonate()) {
abort(403);
}

$user_to_impersonate = $this->manager->findUserById($id, $guardName);

if (method_exists($user_to_impersonate, 'canBeImpersonated') && !$user_to_impersonate->canBeImpersonated()) {
if (method_exists($user_to_impersonate, 'canBeImpersonated') && ! $user_to_impersonate->canBeImpersonated()) {
abort(403);
}

Expand Down
12 changes: 6 additions & 6 deletions src/Http/Middleware/Impersonate.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,19 @@ public function handle($request, $next)

auth()->check() &&

!($response instanceof RedirectResponse) &&
! ($response instanceof RedirectResponse) &&

!($response instanceof BinaryFileResponse) &&
! ($response instanceof BinaryFileResponse) &&

!($response instanceof StreamedResponse) &&
! ($response instanceof StreamedResponse) &&

!($response instanceof JsonResponse) &&
! ($response instanceof JsonResponse) &&

!$request->expectsJson() &&
! $request->expectsJson() &&

Str::startsWith($response->headers->get('Content-Type'), 'text/html') &&

!Str::contains($request->path(), 'nova-api')
! Str::contains($request->path(), 'nova-api')
) {

/** @var Response $response * */
Expand Down

0 comments on commit 841dfd0

Please sign in to comment.