@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | |
10 | 10 | public function search(&$entities, $type = null, $search = null) |
11 | 11 | { |
12 | - $reflection = new ReflectionProperty($entities, 'model'); |
|
12 | + $reflection = new ReflectionProperty($entities, 'model'); |
|
13 | 13 | $reflection->setAccessible(true); |
14 | 14 | $classname = $reflection->getValue($entities); |
15 | 15 | |
@@ -20,14 +20,14 @@ discard block |
||
20 | 20 | $criteria = explode(' ', $search); |
21 | 21 | $columns = $classname::SEARCH_CRITERIA[$type]; |
22 | 22 | |
23 | - $entities = $entities->where( function($q) use ($columns, $criteria) { |
|
23 | + $entities = $entities->where(function($q) use ($columns, $criteria) { |
|
24 | 24 | foreach ($columns as $column) { |
25 | 25 | if (is_array($column)) { |
26 | 26 | $relation = $column; |
27 | - foreach($relation as $table => $column) { |
|
27 | + foreach ($relation as $table => $column) { |
|
28 | 28 | $q->whereHas($table, |
29 | 29 | function($query) use ($column, $criteria) { |
30 | - foreach($criteria as $value) { |
|
30 | + foreach ($criteria as $value) { |
|
31 | 31 | $query->orWhere($column, 'LIKE', $value); |
32 | 32 | } |
33 | 33 | } |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | } else { |
37 | 37 | $q->orWhere( |
38 | 38 | function($query) use ($column, $criteria) { |
39 | - foreach($criteria as $value) { |
|
39 | + foreach ($criteria as $value) { |
|
40 | 40 | $query->orWhere($column, 'LIKE', $value); |
41 | 41 | } |
42 | 42 | } |
@@ -54,7 +54,7 @@ |
||
54 | 54 | { |
55 | 55 | $router->group([ |
56 | 56 | 'namespace' => $this->namespace, 'middleware' => 'web', |
57 | - ], function ($router) { |
|
57 | + ], function($router) { |
|
58 | 58 | require app_path('Http/routes.php'); |
59 | 59 | }); |
60 | 60 | } |
@@ -11,7 +11,7 @@ |
||
11 | 11 | | |
12 | 12 | */ |
13 | 13 | |
14 | -Route::group(['middleware' => 'installed'], function () { |
|
14 | +Route::group(['middleware' => 'installed'], function() { |
|
15 | 15 | |
16 | 16 | Route::auth(); |
17 | 17 |
@@ -27,7 +27,7 @@ |
||
27 | 27 | } |
28 | 28 | } |
29 | 29 | $view->with('enable', $enable) |
30 | - ->with('title', $title) |
|
31 | - ->with('contents', $contents); |
|
30 | + ->with('title', $title) |
|
31 | + ->with('contents', $contents); |
|
32 | 32 | } |
33 | 33 | } |
@@ -20,7 +20,7 @@ |
||
20 | 20 | $contents = ''; |
21 | 21 | if (config('kleis.legal_notice')) { |
22 | 22 | $mdfile = public_path('markdown/legal/'.config('kleis.legal_notice').'-'.config('app.locale').'.md'); |
23 | - if (file_exists($mdfile)){ |
|
23 | + if (file_exists($mdfile)) { |
|
24 | 24 | list($title, $text) = explode(PHP_EOL, file_get_contents($mdfile), 2); |
25 | 25 | $enable = true; |
26 | 26 | $contents = Markdown::parse($text)->toHtml(); |
@@ -61,7 +61,7 @@ |
||
61 | 61 | /** |
62 | 62 | * Handle an authentication attempt. |
63 | 63 | * |
64 | - * @return Response |
|
64 | + * @return \Illuminate\Http\RedirectResponse|null |
|
65 | 65 | */ |
66 | 66 | public function authenticate(Request $request) |
67 | 67 | { |
@@ -68,10 +68,10 @@ |
||
68 | 68 | $credentials = $request->only('email', 'password'); |
69 | 69 | |
70 | 70 | if (Auth::attempt([ |
71 | - 'email' => $credentials['email'], |
|
72 | - 'password' => $credentials['password'], |
|
73 | - 'status' => App\User::USER_ENABLED |
|
74 | - ])) { |
|
71 | + 'email' => $credentials['email'], |
|
72 | + 'password' => $credentials['password'], |
|
73 | + 'status' => App\User::USER_ENABLED |
|
74 | + ])) { |
|
75 | 75 | // Authentication passed... |
76 | 76 | return redirect()->intended('home'); |
77 | 77 | } |
@@ -15,27 +15,27 @@ |
||
15 | 15 | const USER_ENABLED = 1; |
16 | 16 | |
17 | 17 | const USER_STATUS = [ |
18 | - 0 => [ 'text' => 'users.disabled', |
|
18 | + 0 => ['text' => 'users.disabled', |
|
19 | 19 | 'icon' => '', |
20 | - 'unicon' => '' ], |
|
21 | - 1 => [ 'text' => 'users.enabled', |
|
20 | + 'unicon' => ''], |
|
21 | + 1 => ['text' => 'users.enabled', |
|
22 | 22 | 'icon' => 'fa-check', |
23 | - 'unicon' => '' ] |
|
23 | + 'unicon' => ''] |
|
24 | 24 | ]; |
25 | 25 | |
26 | 26 | const USER_LEVEL = [ |
27 | - 1 => [ 'text' => 'users.access.local', |
|
27 | + 1 => ['text' => 'users.access.local', |
|
28 | 28 | 'icon' => 'fa-support', |
29 | - 'unicon' => '' ], |
|
30 | - 3 => [ 'text' => 'users.access.global', |
|
29 | + 'unicon' => ''], |
|
30 | + 3 => ['text' => 'users.access.global', |
|
31 | 31 | 'icon' => 'fa-globe', |
32 | - 'unicon' => '' ], |
|
33 | - 5 => [ 'text' => 'users.access.admin', |
|
32 | + 'unicon' => ''], |
|
33 | + 5 => ['text' => 'users.access.admin', |
|
34 | 34 | 'icon' => 'fa-shield', |
35 | - 'unicon' => '' ], |
|
36 | - 9 => [ 'text' => 'users.access.super', |
|
35 | + 'unicon' => ''], |
|
36 | + 9 => ['text' => 'users.access.super', |
|
37 | 37 | 'icon' => 'fa-rocket', |
38 | - 'unicon' => '' ], |
|
38 | + 'unicon' => ''], |
|
39 | 39 | ]; |
40 | 40 | |
41 | 41 | const SEARCH_CRITERIA = [ |
@@ -47,19 +47,19 @@ |
||
47 | 47 | |
48 | 48 | $flagCI = $this->option('ci'); |
49 | 49 | if ($flagCI === false) { |
50 | - $bar = $this->output->createProgressBar($count); |
|
50 | + $bar = $this->output->createProgressBar($count); |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | foreach ($accounts as $account) { |
54 | 54 | $account->disable(); |
55 | 55 | if (isset($bar)) { |
56 | - $bar->advance(); |
|
56 | + $bar->advance(); |
|
57 | 57 | } |
58 | 58 | } |
59 | 59 | |
60 | 60 | if (isset($bar)) { |
61 | - $bar->finish(); |
|
62 | - $this->info("\n"); |
|
61 | + $bar->finish(); |
|
62 | + $this->info("\n"); |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | $this->info("{$count} accounts disabled"); |
@@ -39,12 +39,12 @@ discard block |
||
39 | 39 | |
40 | 40 | private function accountSummary() |
41 | 41 | { |
42 | - $list = [ 'total' => 0, 'summary' => []]; |
|
42 | + $list = ['total' => 0, 'summary' => []]; |
|
43 | 43 | $categories = Category::orderBy('name', 'asc')->get(); |
44 | 44 | foreach ($categories as $category) { |
45 | 45 | $count = Account::where('category_id', $category->id)->count(); |
46 | 46 | if ($count) { |
47 | - $list['summary'][]= [ |
|
47 | + $list['summary'][] = [ |
|
48 | 48 | 'count' => $count, |
49 | 49 | 'text' => $category->name |
50 | 50 | ]; |
@@ -56,11 +56,11 @@ discard block |
||
56 | 56 | |
57 | 57 | private function groupSummary() |
58 | 58 | { |
59 | - $list = [ 'total' => 0, 'summary' => []]; |
|
59 | + $list = ['total' => 0, 'summary' => []]; |
|
60 | 60 | $groups = Group::orderBy('name', 'asc')->get(); |
61 | 61 | foreach ($groups as $group) { |
62 | 62 | $count = Account::where('group_id', $group->id)->count(); |
63 | - $list['summary'][]= [ |
|
63 | + $list['summary'][] = [ |
|
64 | 64 | 'count' => $count, |
65 | 65 | 'text' => $group->name |
66 | 66 | ]; |
@@ -71,12 +71,12 @@ discard block |
||
71 | 71 | |
72 | 72 | private function listSummary() |
73 | 73 | { |
74 | - $list = [ 'total' => 0, 'summary' => [] ]; |
|
75 | - $types = [ 'domain', 'url' ]; |
|
74 | + $list = ['total' => 0, 'summary' => []]; |
|
75 | + $types = ['domain', 'url']; |
|
76 | 76 | foreach ($types as $type) { |
77 | 77 | $count = ProxyListItem::where('type', $type)->count(); |
78 | 78 | if ($count) { |
79 | - $list['summary'][]= [ |
|
79 | + $list['summary'][] = [ |
|
80 | 80 | 'count' => $count, |
81 | 81 | 'text' => "{$type}s" |
82 | 82 | ]; |
@@ -88,11 +88,11 @@ discard block |
||
88 | 88 | |
89 | 89 | private function userSummary() |
90 | 90 | { |
91 | - $list = [ 'total' => 0, 'summary' => []]; |
|
91 | + $list = ['total' => 0, 'summary' => []]; |
|
92 | 92 | foreach (User::USER_LEVEL as $id => $level) { |
93 | 93 | $count = User::where('level', $id)->count(); |
94 | 94 | if ($count) { |
95 | - $list['summary'][]= [ |
|
95 | + $list['summary'][] = [ |
|
96 | 96 | 'count' => $count, |
97 | 97 | 'text' => $level['text'] |
98 | 98 | ]; |
@@ -36,31 +36,31 @@ |
||
36 | 36 | * |
37 | 37 | * @return mixed |
38 | 38 | */ |
39 | - public function handle() |
|
40 | - { |
|
41 | - $categories = Category::get(); |
|
39 | + public function handle() |
|
40 | + { |
|
41 | + $categories = Category::get(); |
|
42 | 42 | |
43 | - if ($categories->isEmpty()) { |
|
44 | - $this->info("No categories to export"); |
|
45 | - return; |
|
46 | - } |
|
43 | + if ($categories->isEmpty()) { |
|
44 | + $this->info("No categories to export"); |
|
45 | + return; |
|
46 | + } |
|
47 | 47 | |
48 | - foreach ($categories as $category){ |
|
49 | - $accounts = $this->fecthAccounts(['category_id' => $category->id]); |
|
48 | + foreach ($categories as $category){ |
|
49 | + $accounts = $this->fecthAccounts(['category_id' => $category->id]); |
|
50 | 50 | |
51 | - $name = normalise($category->name); |
|
52 | - $filename = "{$this->exportFolder}/{$name}{$this->exportFileExt}"; |
|
51 | + $name = normalise($category->name); |
|
52 | + $filename = "{$this->exportFolder}/{$name}{$this->exportFileExt}"; |
|
53 | 53 | |
54 | - $count = $this->exportAccounts($accounts, $filename, false, $this->option('ci')); |
|
54 | + $count = $this->exportAccounts($accounts, $filename, false, $this->option('ci')); |
|
55 | 55 | |
56 | - try { |
|
57 | - $url = $this->exportToLocation($filename); |
|
58 | - } catch(\Exception $e) { |
|
59 | - $this->error('Export cancelled by user!'); |
|
60 | - return; |
|
61 | - } |
|
56 | + try { |
|
57 | + $url = $this->exportToLocation($filename); |
|
58 | + } catch(\Exception $e) { |
|
59 | + $this->error('Export cancelled by user!'); |
|
60 | + return; |
|
61 | + } |
|
62 | 62 | |
63 | - $this->info("{$count} accounts '{$category->name}' exported into file '{$url}'"); |
|
64 | - } |
|
65 | - } |
|
63 | + $this->info("{$count} accounts '{$category->name}' exported into file '{$url}'"); |
|
64 | + } |
|
65 | + } |
|
66 | 66 | } |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | return; |
46 | 46 | } |
47 | 47 | |
48 | - foreach ($categories as $category){ |
|
48 | + foreach ($categories as $category) { |
|
49 | 49 | $accounts = $this->fecthAccounts(['category_id' => $category->id]); |
50 | 50 | |
51 | 51 | $name = normalise($category->name); |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | |
56 | 56 | try { |
57 | 57 | $url = $this->exportToLocation($filename); |
58 | - } catch(\Exception $e) { |
|
58 | + } catch (\Exception $e) { |
|
59 | 59 | $this->error('Export cancelled by user!'); |
60 | 60 | return; |
61 | 61 | } |