Completed
Branch develop (a455fd)
by Greg
16:10
created
app/Account.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,6 @@
 block discarded – undo
4 4
 
5 5
 use Illuminate\Database\Eloquent\Model;
6 6
 use App\User;
7
-
8 7
 use WhiteHat101\Crypt\APR1_MD5;
9 8
 
10 9
 class Account extends Model
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -10,12 +10,12 @@
 block discarded – undo
10 10
 class Account extends Model
11 11
 {
12 12
     const ACCOUNT_STATUS = [
13
-        0 => [  'text' => 'accounts.disabled',
13
+        0 => ['text' => 'accounts.disabled',
14 14
                 'icon' => 'fa-ban',
15
-                'unicon' => '' ],
16
-        1 => [  'text' => 'accounts.enabled',
15
+                'unicon' => ''],
16
+        1 => ['text' => 'accounts.enabled',
17 17
                 'icon' => 'fa-globe',
18
-                'unicon' => '' ]
18
+                'unicon' => '']
19 19
     ];
20 20
 
21 21
     const SEARCH_CRITERIA = [
Please login to merge, or discard this patch.
app/Console/Commands/ExportWhitelists.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -50,6 +50,9 @@
 block discarded – undo
50 50
         }
51 51
     }
52 52
 
53
+    /**
54
+     * @param boolean $isWhiteList
55
+     */
53 56
     private function exportProxyList($type, $isWhiteList)
54 57
     {
55 58
         $items = ProxyListItem::where('type', $type)
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@
 block discarded – undo
42 42
     public function handle()
43 43
     {
44 44
         $whitelist = empty($this->option('blacklist'));
45
-        if ( false === empty($this->option('list'))) {
45
+        if (false === empty($this->option('list'))) {
46 46
             $this->exportProxyList($this->option('list'), $whitelist);
47 47
         } else {
48 48
             $this->exportProxyList('domain', $whitelist);
Please login to merge, or discard this patch.
app/Console/Commands/UpdateAccounts.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,6 @@
 block discarded – undo
4 4
 
5 5
 use Illuminate\Console\Command;
6 6
 use App\Account;
7
-use Storage;
8 7
 
9 8
 class UpdateAccounts extends Command
10 9
 {
Please login to merge, or discard this patch.
app/Http/Controllers/AccountController.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
     /**
109 109
      * Add a new account.
110 110
      *
111
-     * @return Response
111
+     * @return \Illuminate\Http\RedirectResponse
112 112
      */
113 113
     public function addAccount(Request $request)
114 114
     {
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
      *
150 150
      * @param  Request  $request
151 151
      * @param  int  $id
152
-     * @return Response
152
+     * @return \Illuminate\Http\RedirectResponse
153 153
      */
154 154
     public function updateAccount(Request $request, $id)
155 155
     {
Please login to merge, or discard this patch.
Unused Use Statements   -3 removed lines patch added patch discarded remove patch
@@ -3,9 +3,6 @@
 block discarded – undo
3 3
 namespace App\Http\Controllers;
4 4
 
5 5
 use Illuminate\Http\Request;
6
-use Illuminate\Routing\UrlGenerator as Url;
7
-
8
-use App\Http\Requests;
9 6
 use App\Account;
10 7
 use App\Group;
11 8
 use App\Category;
Please login to merge, or discard this patch.
app/Http/Controllers/AdminController.php 2 patches
Doc Comments   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
     /**
77 77
      * Add a new user.
78 78
      *
79
-     * @return Response
79
+     * @return \Illuminate\Http\RedirectResponse
80 80
      */
81 81
     public function addUser(Request $request)
82 82
     {
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
      *
115 115
      * @param  Request  $request
116 116
      * @param  int  $id
117
-     * @return Response
117
+     * @return \Illuminate\Http\RedirectResponse
118 118
      */
119 119
     public function updateUser(Request $request, $id = 0)
120 120
     {
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
      * Enable an user.
170 170
      *
171 171
      * @param  int  $id
172
-     * @return Response
172
+     * @return \Illuminate\Http\RedirectResponse
173 173
      */
174 174
     public function enableUser($id)
175 175
     {
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
      * Disable an user.
187 187
      *
188 188
      * @param  int  $id
189
-     * @return Response
189
+     * @return \Illuminate\Http\RedirectResponse
190 190
      */
191 191
     public function disableUser($id)
192 192
     {
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
      * Remove an user.
204 204
      *
205 205
      * @param  int  $id
206
-     * @return Response
206
+     * @return \Illuminate\Http\RedirectResponse
207 207
      */
208 208
     public function removeUser($id)
209 209
     {
Please login to merge, or discard this patch.
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -3,8 +3,6 @@
 block discarded – undo
3 3
 namespace App\Http\Controllers;
4 4
 
5 5
 use Illuminate\Http\Request;
6
-
7
-use App\Http\Requests;
8 6
 use App\User;
9 7
 use App\Group;
10 8
 use Auth;
Please login to merge, or discard this patch.
app/Http/Controllers/Auth/AuthController.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@
 block discarded – undo
73 73
     /**
74 74
      * Handle an authentication attempt.
75 75
      *
76
-     * @return Response
76
+     * @return \Illuminate\Http\RedirectResponse|null
77 77
      */
78 78
     public function authenticate()
79 79
     {
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,6 @@
 block discarded – undo
2 2
 
3 3
 namespace App\Http\Controllers\Auth;
4 4
 
5
-use App\User;
6 5
 use Validator;
7 6
 use App\Http\Controllers\Controller;
8 7
 use Illuminate\Foundation\Auth\ThrottlesLogins;
Please login to merge, or discard this patch.
app/Http/Controllers/CategoryController.php 2 patches
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -3,8 +3,6 @@
 block discarded – undo
3 3
 namespace App\Http\Controllers;
4 4
 
5 5
 use Illuminate\Http\Request;
6
-
7
-use App\Http\Requests;
8 6
 use App\Category;
9 7
 
10 8
 class CategoryController extends Controller
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -96,7 +96,7 @@
 block discarded – undo
96 96
     {
97 97
         $category = Category::findOrFail($id);
98 98
         $accounts = $category->accounts()->where('status', 0);
99
-        if (count($accounts) > 0 ) {
99
+        if (count($accounts) > 0) {
100 100
             $accounts->delete();
101 101
         }
102 102
         return redirect()->back()->with(
Please login to merge, or discard this patch.
app/Http/Controllers/GroupController.php 2 patches
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -3,8 +3,6 @@
 block discarded – undo
3 3
 namespace App\Http\Controllers;
4 4
 
5 5
 use Illuminate\Http\Request;
6
-
7
-use App\Http\Requests;
8 6
 use App\Group;
9 7
 
10 8
 class GroupController extends Controller
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -100,7 +100,7 @@
 block discarded – undo
100 100
     {
101 101
         $group = Group::findOrFail($id);
102 102
         $accounts = Group::Find($id)->accounts()->where('status', 0);
103
-        if (count($accounts) > 0 ) {
103
+        if (count($accounts) > 0) {
104 104
             $accounts->delete();
105 105
         }
106 106
         return redirect()->back()->with(
Please login to merge, or discard this patch.
app/Http/Controllers/HomeController.php 2 patches
Unused Use Statements   -3 removed lines patch added patch discarded remove patch
@@ -2,9 +2,6 @@
 block discarded – undo
2 2
 
3 3
 namespace App\Http\Controllers;
4 4
 
5
-use App\Http\Requests;
6
-use Illuminate\Http\Request;
7
-
8 5
 use App\Account;
9 6
 use App\Group;
10 7
 use App\ProxyListItem;
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -42,12 +42,12 @@  discard block
 block discarded – undo
42 42
 
43 43
     private function accountSummary()
44 44
     {
45
-        $list = [ 'total' => 0, 'summary' => []];
45
+        $list = ['total' => 0, 'summary' => []];
46 46
         $categories = Category::orderBy('name', 'asc')->get();
47 47
         foreach ($categories as $category) {
48 48
             $count = Account::where('category_id', $category->id)->count();
49 49
             if ($count) {
50
-                $list['summary'][]= [
50
+                $list['summary'][] = [
51 51
                     'count' => $count,
52 52
                     'text' => $category->name
53 53
                 ];
@@ -59,11 +59,11 @@  discard block
 block discarded – undo
59 59
 
60 60
     private function groupSummary()
61 61
     {
62
-        $list = [ 'total' => 0, 'summary' => []];
62
+        $list = ['total' => 0, 'summary' => []];
63 63
         $groups = Group::orderBy('name', 'asc')->get();
64 64
         foreach ($groups as $group) {
65 65
             $count = Account::where('group_id', $group->id)->count();
66
-            $list['summary'][]= [
66
+            $list['summary'][] = [
67 67
                 'count' => $count,
68 68
                 'text' => $group->name
69 69
             ];
@@ -74,11 +74,11 @@  discard block
 block discarded – undo
74 74
 
75 75
     private function categorySummary()
76 76
     {
77
-        $list = [ 'total' => 0, 'summary' => []];
77
+        $list = ['total' => 0, 'summary' => []];
78 78
         $categories = Category::get();
79 79
         foreach ($categories as $category) {
80 80
             $count = Account::where('category_id', $category->id)->count();
81
-            $list['summary'][]= [
81
+            $list['summary'][] = [
82 82
                 'count' => $count,
83 83
                 'text' => $category->name
84 84
             ];
@@ -89,12 +89,12 @@  discard block
 block discarded – undo
89 89
 
90 90
     private function listSummary()
91 91
     {
92
-        $list = [ 'total' => 0, 'summary' => [] ];
93
-        $types = [ 'domain', 'url' ];
92
+        $list = ['total' => 0, 'summary' => []];
93
+        $types = ['domain', 'url'];
94 94
         foreach ($types as $type) {
95 95
             $count = ProxyListItem::where('type', $type)->count();
96 96
             if ($count) {
97
-                $list['summary'][]= [
97
+                $list['summary'][] = [
98 98
                     'count' => $count,
99 99
                     'text' => "{$type}s"
100 100
                 ];
@@ -106,11 +106,11 @@  discard block
 block discarded – undo
106 106
 
107 107
     private function userSummary()
108 108
     {
109
-        $list = [ 'total' => 0, 'summary' => []];
109
+        $list = ['total' => 0, 'summary' => []];
110 110
         foreach (User::USER_LEVEL as $id => $level) {
111 111
             $count = User::where('level', $id)->count();
112 112
             if ($count) {
113
-                $list['summary'][]= [
113
+                $list['summary'][] = [
114 114
                     'count' => $count,
115 115
                     'text' => $level['text']
116 116
                 ];
Please login to merge, or discard this patch.