Completed
Push — master ( d2f599...3fd322 )
by Alexander
07:48
created
config/pretend.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@
 block discarded – undo
1
-<?php declare(strict_types=1);
1
+<?php declare(strict_types = 1);
2 2
 
3 3
 return [
4 4
     'impersonate' => [
Please login to merge, or discard this patch.
src/Event/Impersonated.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@
 block discarded – undo
1
-<?php declare(strict_types=1);
1
+<?php declare(strict_types = 1);
2 2
 
3 3
 namespace Scif\LaravelPretend\Event;
4 4
 
Please login to merge, or discard this patch.
src/Interfaces/Impersonable.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@
 block discarded – undo
1
-<?php declare(strict_types=1);
1
+<?php declare(strict_types = 1);
2 2
 
3 3
 namespace Scif\LaravelPretend\Interfaces;
4 4
 
Please login to merge, or discard this patch.
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   +4 added lines, -4 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;
4 4
 
@@ -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/Event/Unimpersonated.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@
 block discarded – undo
1
-<?php declare(strict_types=1);
1
+<?php declare(strict_types = 1);
2 2
 
3 3
 namespace Scif\LaravelPretend\Event;
4 4
 
Please login to merge, or discard this patch.
src/Middleware/ForbidImpersonation.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@
 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
 
Please login to merge, or discard this patch.
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.