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 Sep 15, 2021
1 parent b540650 commit 5a59073
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions src/Contracts/Impersonate.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ interface Impersonate
public function clear();

/**
* @param int $id
* @param string|null $guardName
* @param int $id
* @param string|null $guardName
* @return \Illuminate\Contracts\Auth\Authenticatable
*/
public function findUserById($id, $guardName = null);
Expand All @@ -27,9 +27,9 @@ public function getImpersonatorId();
public function isImpersonating();

/**
* @param \Illuminate\Contracts\Auth\Authenticatable $from
* @param \Illuminate\Contracts\Auth\Authenticatable $to
* @param string|null $guardName
* @param \Illuminate\Contracts\Auth\Authenticatable $from
* @param \Illuminate\Contracts\Auth\Authenticatable $to
* @param string|null $guardName
* @return bool
*/
public function take($from, $to, $guardName = null);
Expand Down
6 changes: 3 additions & 3 deletions src/Http/Controllers/ImpersonateController.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ public function take(Request $request, $id, $guardName = null)
if (method_exists($request->user(), 'canImpersonate')) {
abort(403);
}

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

if (! $request->user()->canImpersonate($user_to_impersonate)) {
abort(403);
}

if (method_exists($user_to_impersonate, 'canBeImpersonated') && ! $user_to_impersonate->canBeImpersonated($request->user())) {
abort(403);
}
Expand Down
4 changes: 2 additions & 2 deletions src/Http/Middleware/Impersonate.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ class Impersonate
/**
* Handle the incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return \Illuminate\Http\Response
*/
public function handle($request, $next)
Expand Down

0 comments on commit 5a59073

Please sign in to comment.