@@ -74,8 +74,9 @@ |
||
74 | 74 | { |
75 | 75 | $ips = explode(PHP_EOL, (string) $this->input('allowed')); |
76 | 76 | |
77 | - if ((bool) $this->input('allow_current_ip')) |
|
78 | - $ips[] = $this->ip(); |
|
77 | + if ((bool) $this->input('allow_current_ip')) { |
|
78 | + $ips[] = $this->ip(); |
|
79 | + } |
|
79 | 80 | |
80 | 81 | return array_unique(array_filter($ips)); |
81 | 82 | } |
@@ -84,8 +84,8 @@ discard block |
||
84 | 84 | private function getResults(PackageManifest $manifest): LengthAwarePaginator |
85 | 85 | { |
86 | 86 | $packages = $manifest->installed() |
87 | - ->unless(empty($this->search), function (Collection $items) { |
|
88 | - return $items->filter(function ($package) { |
|
87 | + ->unless(empty($this->search), function(Collection $items) { |
|
88 | + return $items->filter(function($package) { |
|
89 | 89 | $needles = explode(' ', Str::lower($this->search)); |
90 | 90 | $haystacks = [ |
91 | 91 | $package['name'], |
@@ -99,13 +99,13 @@ discard block |
||
99 | 99 | return false; |
100 | 100 | }); |
101 | 101 | }) |
102 | - ->sortBy(function ($package) { |
|
102 | + ->sortBy(function($package) { |
|
103 | 103 | if ($this->sortField === 'name') |
104 | 104 | return $package['name']; |
105 | 105 | |
106 | 106 | return $package['name']; |
107 | 107 | }, SORT_REGULAR, ! $this->sortAsc) |
108 | - ->transform(function ($package) { |
|
108 | + ->transform(function($package) { |
|
109 | 109 | return $package + [ |
110 | 110 | 'key' => str_replace('/', '+', $package['name']), |
111 | 111 | ]; |
@@ -92,16 +92,18 @@ |
||
92 | 92 | ]; |
93 | 93 | |
94 | 94 | foreach ($haystacks as $haystack) { |
95 | - if (Str::contains(Str::lower($haystack), $needles)) |
|
96 | - return true; |
|
95 | + if (Str::contains(Str::lower($haystack), $needles)) { |
|
96 | + return true; |
|
97 | + } |
|
97 | 98 | } |
98 | 99 | |
99 | 100 | return false; |
100 | 101 | }); |
101 | 102 | }) |
102 | 103 | ->sortBy(function ($package) { |
103 | - if ($this->sortField === 'name') |
|
104 | - return $package['name']; |
|
104 | + if ($this->sortField === 'name') { |
|
105 | + return $package['name']; |
|
106 | + } |
|
105 | 107 | |
106 | 108 | return $package['name']; |
107 | 109 | }, SORT_REGULAR, ! $this->sortAsc) |
@@ -88,11 +88,11 @@ discard block |
||
88 | 88 | private function getResults(PolicyManager $manager, Gate $gate): LengthAwarePaginator |
89 | 89 | { |
90 | 90 | $abilities = $manager->abilities() |
91 | - ->map(function (Ability $ability) use ($gate) { |
|
91 | + ->map(function(Ability $ability) use ($gate) { |
|
92 | 92 | return $ability->setMeta('is_registered', $gate->has($ability->key())); |
93 | 93 | }) |
94 | - ->unless(empty($this->search), function (Collection $items) { |
|
95 | - return $items->filter(function (Ability $ability) { |
|
94 | + ->unless(empty($this->search), function(Collection $items) { |
|
95 | + return $items->filter(function(Ability $ability) { |
|
96 | 96 | $needles = explode(' ', Str::lower($this->search)); |
97 | 97 | $haystacks = [ |
98 | 98 | $ability->key(), |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | return false; |
109 | 109 | }); |
110 | 110 | }) |
111 | - ->sortBy(function (Ability $ability) { |
|
111 | + ->sortBy(function(Ability $ability) { |
|
112 | 112 | if ($this->sortField === 'name') |
113 | 113 | return $ability->meta('name', ''); |
114 | 114 |
@@ -101,16 +101,18 @@ |
||
101 | 101 | ]; |
102 | 102 | |
103 | 103 | foreach ($haystacks as $haystack) { |
104 | - if (Str::contains(Str::lower($haystack), $needles)) |
|
105 | - return true; |
|
104 | + if (Str::contains(Str::lower($haystack), $needles)) { |
|
105 | + return true; |
|
106 | + } |
|
106 | 107 | } |
107 | 108 | |
108 | 109 | return false; |
109 | 110 | }); |
110 | 111 | }) |
111 | 112 | ->sortBy(function (Ability $ability) { |
112 | - if ($this->sortField === 'name') |
|
113 | - return $ability->meta('name', ''); |
|
113 | + if ($this->sortField === 'name') { |
|
114 | + return $ability->meta('name', ''); |
|
115 | + } |
|
114 | 116 | |
115 | 117 | // $this->sortField === key or else, do the same sorting |
116 | 118 | return $ability->key(); |
@@ -123,8 +123,8 @@ discard block |
||
123 | 123 | */ |
124 | 124 | private function applySearchFilter(): Closure |
125 | 125 | { |
126 | - return function (RouteCollection $routes): RouteCollection { |
|
127 | - return $routes->filter(function (Route $route): bool { |
|
126 | + return function(RouteCollection $routes): RouteCollection { |
|
127 | + return $routes->filter(function(Route $route): bool { |
|
128 | 128 | $needles = explode(' ', Str::lower($this->search)); |
129 | 129 | $haystacks = [ |
130 | 130 | $route->uri, |
@@ -149,8 +149,8 @@ discard block |
||
149 | 149 | */ |
150 | 150 | private function applyMethodFilter(): Closure |
151 | 151 | { |
152 | - return function (RouteCollection $routes): RouteCollection { |
|
153 | - return $routes->filter(function (Route $route): bool { |
|
152 | + return function(RouteCollection $routes): RouteCollection { |
|
153 | + return $routes->filter(function(Route $route): bool { |
|
154 | 154 | $methods = Arr::pluck($route->methods, 'name'); |
155 | 155 | |
156 | 156 | return in_array($this->routeMethod, $methods); |
@@ -133,8 +133,9 @@ |
||
133 | 133 | ]; |
134 | 134 | |
135 | 135 | foreach ($haystacks as $haystack) { |
136 | - if (Str::contains(Str::lower($haystack), $needles)) |
|
137 | - return true; |
|
136 | + if (Str::contains(Str::lower($haystack), $needles)) { |
|
137 | + return true; |
|
138 | + } |
|
138 | 139 | } |
139 | 140 | |
140 | 141 | return false; |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | */ |
34 | 34 | public function compose(View $view): void |
35 | 35 | { |
36 | - $extensions = (array) config('arcanesoft.foundation.system.checks.php-extensions');; |
|
36 | + $extensions = (array) config('arcanesoft.foundation.system.checks.php-extensions'); ; |
|
37 | 37 | |
38 | 38 | $view->with('requiredPhpExtensions', static::getRequiredExtensions($extensions)); |
39 | 39 | } |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | */ |
65 | 65 | protected static function getRequiredExtensions(array $extensions): array |
66 | 66 | { |
67 | - return array_map(function ($extension) { |
|
67 | + return array_map(function($extension) { |
|
68 | 68 | return extension_loaded($extension); |
69 | 69 | }, array_combine($extensions, $extensions)); |
70 | 70 | } |
@@ -68,7 +68,7 @@ |
||
68 | 68 | */ |
69 | 69 | protected static function getFoldersPermissions(array $folders): array |
70 | 70 | { |
71 | - return array_map(function ($folder) { |
|
71 | + return array_map(function($folder) { |
|
72 | 72 | $path = base_path($folder); |
73 | 73 | |
74 | 74 | return [ |
@@ -54,7 +54,7 @@ |
||
54 | 54 | */ |
55 | 55 | private static function calculateEntriesByLevel(LogViewer $logViewer): array |
56 | 56 | { |
57 | - return $logViewer->all()->reduce(function ($count, Log $log) { |
|
57 | + return $logViewer->all()->reduce(function($count, Log $log) { |
|
58 | 58 | foreach ($log->entries()->groupBy('level') as $level => $entries) { |
59 | 59 | /** @var \Arcanedev\LogViewer\Entities\LogEntryCollection $entries */ |
60 | 60 | $count[$level] = ($count[$level] ?? 0) + $entries->count(); |
@@ -40,7 +40,7 @@ |
||
40 | 40 | */ |
41 | 41 | public function up(): void |
42 | 42 | { |
43 | - $this->createSchema(function (Blueprint $table) { |
|
43 | + $this->createSchema(function(Blueprint $table) { |
|
44 | 44 | $table->id(); |
45 | 45 | $table->morphs('two_factorable'); |
46 | 46 | $table->text('secret')->nullable(); |
@@ -96,8 +96,8 @@ |
||
96 | 96 | 'two_factors' => 'two_factors', |
97 | 97 | ], |
98 | 98 | |
99 | - // Models |
|
100 | - // ---------------------------------- |
|
99 | + // Models |
|
100 | + // ---------------------------------- |
|
101 | 101 | |
102 | 102 | 'models' => [ |
103 | 103 | 'user' => App\Models\User::class, |