Completed
Push — master ( 2f9820...cf246a )
by Alexander
09:44
created
src/LaravelPretendServiceProvider.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -36,10 +36,10 @@
 block discarded – undo
36 36
     public function register()
37 37
     {
38 38
         $this->app->when(Impersonator::class)
39
-          ->needs(UserProvider::class)
40
-          ->give(function (): UserProvider {
41
-              return \Auth::getProvider();
42
-          });
39
+            ->needs(UserProvider::class)
40
+            ->give(function (): UserProvider {
41
+                return \Auth::getProvider();
42
+            });
43 43
 
44 44
         $this->app->singleton(Impersonator::class, Impersonator::class);
45 45
     }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -17,8 +17,8 @@  discard block
 block discarded – undo
17 17
     {
18 18
         $configPath = __DIR__ . '/../config/pretend.php';
19 19
 
20
-        if ( ! $this->isLumen()) {
21
-            $this->publishes([$configPath => config_path('pretend.php')], 'config');
20
+        if (!$this->isLumen()) {
21
+            $this->publishes([ $configPath => config_path('pretend.php') ], 'config');
22 22
         }
23 23
 
24 24
         $this->mergeConfigFrom($configPath, 'pretend');
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
     {
38 38
         $this->app->when(Impersonator::class)
39 39
           ->needs(UserProvider::class)
40
-          ->give(function (): UserProvider {
40
+          ->give(function(): UserProvider {
41 41
               return \Auth::getProvider();
42 42
           });
43 43
 
Please login to merge, or discard this patch.
src/Middleware/Impersonate.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 
82 82
             if (!$request->isXmlHttpRequest() && $request->isMethod('GET')) {
83 83
                 $input = $request->input();
84
-                unset($input['_switch_user']);
84
+                unset($input[ '_switch_user' ]);
85 85
                 $input += $request->route()->parameters();
86 86
 
87 87
                 return $this->redirect->route(
@@ -104,11 +104,11 @@  discard block
 block discarded – undo
104 104
      */
105 105
     protected function checkPermission(string $username)
106 106
     {
107
-        $ability  = $this->config->get('pretend.impersonate.auth_check');
107
+        $ability = $this->config->get('pretend.impersonate.auth_check');
108 108
 
109 109
         if (!$this->gate->has($ability)) {
110 110
 
111
-            $this->gate->define($ability, function ($user): bool {
111
+            $this->gate->define($ability, function($user): bool {
112 112
                 if (!$user instanceof Impersonable) {
113 113
                     return false;
114 114
                 }
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
             });
118 118
         }
119 119
 
120
-        if (!$this->gate->forUser($this->guard->user())->check($ability, [$username])) {
120
+        if (!$this->gate->forUser($this->guard->user())->check($ability, [ $username ])) {
121 121
             abort(403, "Current user have no ability '{$ability}'");
122 122
         }
123 123
     }
Please login to merge, or discard this patch.