Completed
Pull Request — master (#63)
by
unknown
02:40
created
database/migrations/2017_03_04_000000_create_bans_table.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
      */
25 25
     public function up(): void
26 26
     {
27
-        Schema::create('bans', function (Blueprint $table) {
27
+        Schema::create('bans', function(Blueprint $table) {
28 28
             $table->increments('id');
29 29
             $table->morphs('bannable');
30 30
             $table->nullableMorphs('created_by');
Please login to merge, or discard this patch.
src/Services/BanService.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
      */
42 42
     public function unban(BannableContract $bannable): void
43 43
     {
44
-        $bannable->bans->each(function ($ban) {
44
+        $bannable->bans->each(function($ban) {
45 45
             $ban->delete();
46 46
         });
47 47
     }
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
             ->where('expired_at', '<=', Carbon::now()->format('Y-m-d H:i:s'))
58 58
             ->get();
59 59
 
60
-        $bans->each(function ($ban) {
60
+        $bans->each(function($ban) {
61 61
             $ban->delete();
62 62
         });
63 63
     }
Please login to merge, or discard this patch.
src/Scopes/BannedAtScope.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
      */
68 68
     protected function addWithBanned(Builder $builder): void
69 69
     {
70
-        $builder->macro('withBanned', function (Builder $builder) {
70
+        $builder->macro('withBanned', function(Builder $builder) {
71 71
             return $builder->withoutGlobalScope($this);
72 72
         });
73 73
     }
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
      */
81 81
     protected function addWithoutBanned(Builder $builder): void
82 82
     {
83
-        $builder->macro('withoutBanned', function (Builder $builder) {
83
+        $builder->macro('withoutBanned', function(Builder $builder) {
84 84
             return $builder->withoutGlobalScope($this)->whereNull('banned_at');
85 85
         });
86 86
     }
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
      */
94 94
     protected function addOnlyBanned(Builder $builder): void
95 95
     {
96
-        $builder->macro('onlyBanned', function (Builder $builder) {
96
+        $builder->macro('onlyBanned', function(Builder $builder) {
97 97
             return $builder->withoutGlobalScope($this)->whereNotNull('banned_at');
98 98
         });
99 99
     }
Please login to merge, or discard this patch.
src/Http/Middleware/LogsOutBannedUser.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@
 block discarded – undo
60 60
             f($redirect_url === null){
61 61
                 return redirect()->back()->withInput()->withErrors($errors);
62 62
             }
63
-            else{
63
+            else {
64 64
                 return redirect($redirect_url)->withInput()->withErrors($errors);
65 65
             }
66 66
         }
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -59,8 +59,7 @@
 block discarded – undo
59 59
             
60 60
             f($redirect_url === null){
61 61
                 return redirect()->back()->withInput()->withErrors($errors);
62
-            }
63
-            else{
62
+            } else{
64 63
                 return redirect($redirect_url)->withInput()->withErrors($errors);
65 64
             }
66 65
         }
Please login to merge, or discard this patch.
src/Http/Middleware/ForbidBannedUser.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -51,10 +51,10 @@
 block discarded – undo
51 51
         ];
52 52
 
53 53
         if ($user && $user instanceof BannableContract && $user->isBanned()) {
54
-            if($redirect_url === null){
54
+            if ($redirect_url === null) {
55 55
                 return redirect()->back()->withInput()->withErrors($errors);
56 56
             }
57
-            else{
57
+            else {
58 58
                 return redirect($redirect_url)->withInput()->withErrors($errors);
59 59
             }
60 60
             
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -53,8 +53,7 @@
 block discarded – undo
53 53
         if ($user && $user instanceof BannableContract && $user->isBanned()) {
54 54
             if($redirect_url === null){
55 55
                 return redirect()->back()->withInput()->withErrors($errors);
56
-            }
57
-            else{
56
+            } else{
58 57
                 return redirect($redirect_url)->withInput()->withErrors($errors);
59 58
             }
60 59
             
Please login to merge, or discard this patch.