Completed
Push — master ( d2f599...3fd322 )
by Alexander
07:48
created
src/Service/Impersonator.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php declare(strict_types=1);
1
+<?php declare(strict_types = 1);
2 2
 
3 3
 namespace Scif\LaravelPretend\Service;
4 4
 
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
      */
102 102
     public function enterImpersonation(string $username)
103 103
     {
104
-        $user     = $this->retrieveUser($username);
104
+        $user = $this->retrieveUser($username);
105 105
 
106 106
         if ($user->getAuthIdentifier() === $this->realUser->getAuthIdentifier()) {
107 107
             abort(403, 'Cannot impersonate yourself');
Please login to merge, or discard this patch.
src/Middleware/Impersonate.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php declare(strict_types=1);
1
+<?php declare(strict_types = 1);
2 2
 
3 3
 namespace Scif\LaravelPretend\Middleware;
4 4
 
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 
80 80
             if (!$request->isXmlHttpRequest() && $request->isMethod('GET')) {
81 81
                 $input = $request->input();
82
-                unset($input['_switch_user']);
82
+                unset($input[ '_switch_user' ]);
83 83
                 $input += $request->route()->parameters();
84 84
 
85 85
                 return $this->redirect->route(
@@ -102,11 +102,11 @@  discard block
 block discarded – undo
102 102
      */
103 103
     protected function checkPermission(string $username)
104 104
     {
105
-        $ability  = $this->config->get('pretend.impersonate.auth_check');
105
+        $ability = $this->config->get('pretend.impersonate.auth_check');
106 106
 
107 107
         if (!$this->gate->has($ability)) {
108 108
 
109
-            $this->gate->define($ability, function ($user): bool {
109
+            $this->gate->define($ability, function($user): bool {
110 110
                 if (!$user instanceof Impersonable) {
111 111
                     return false;
112 112
                 }
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
             });
116 116
         }
117 117
 
118
-        if (!$this->gate->forUser($this->guard->user())->check($ability, [$username])) {
118
+        if (!$this->gate->forUser($this->guard->user())->check($ability, [ $username ])) {
119 119
             abort(403, "Current user have no ability '{$ability}'");
120 120
         }
121 121
     }
Please login to merge, or discard this patch.