Completed
Branch master (7becad)
by Alexander
07:29
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/Middleware/ForbidImpersonation.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\Middleware;
4 4
 
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
      */
33 33
     public function handle(Request $request, Closure $next)
34 34
     {
35
-        $this->eventDispatcher->listen(Impersonated::class, function () {
35
+        $this->eventDispatcher->listen(Impersonated::class, function() {
36 36
             abort(403, 'This route is forbidden to access as impersonated user');
37 37
         });
38 38
 
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
 
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 
75 75
             if (!$request->isXmlHttpRequest() && $request->isMethod('GET')) {
76 76
                 $input = $request->input();
77
-                unset($input['_switch_user']);
77
+                unset($input[ '_switch_user' ]);
78 78
                 $input += $request->route()->parameters();
79 79
 
80 80
                 return $this->redirect->route(
@@ -97,11 +97,11 @@  discard block
 block discarded – undo
97 97
      */
98 98
     protected function checkPermission(string $username)
99 99
     {
100
-        $ability  = $this->config->get('pretend.impersonate.auth_check');
100
+        $ability = $this->config->get('pretend.impersonate.auth_check');
101 101
 
102 102
         if (!$this->gate->has($ability)) {
103 103
 
104
-            $this->gate->define($ability, function ($user): bool {
104
+            $this->gate->define($ability, function($user): bool {
105 105
                 if (!$user instanceof Impersonable) {
106 106
                     return false;
107 107
                 }
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
             });
111 111
         }
112 112
 
113
-        if (!$this->gate->forUser($this->guard->user())->check($ability, [ $username] )) {
113
+        if (!$this->gate->forUser($this->guard->user())->check($ability, [ $username ])) {
114 114
             abort(403, "Current user have no ability '{$ability}'");
115 115
         }
116 116
     }
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/Service/Impersonator.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\Service;
4 4
 
Please login to merge, or discard this patch.
src/Event/Unimprersonated.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.