@@ -239,14 +239,15 @@ |
||
| 239 | 239 | */ |
| 240 | 240 | protected function parseUrl(array $attributes) : void |
| 241 | 241 | { |
| 242 | - if (isset($attributes['url'])) |
|
| 243 | - $this->setUrl($attributes['url']); |
|
| 244 | - elseif (isset($attributes['route'])) |
|
| 245 | - $this->route(...Arr::wrap($attributes['route'])); |
|
| 246 | - elseif (isset($attributes['action'])) |
|
| 247 | - $this->action(...Arr::wrap($attributes['action'])); |
|
| 248 | - else |
|
| 249 | - $this->setUrl('#'); |
|
| 242 | + if (isset($attributes['url'])) { |
|
| 243 | + $this->setUrl($attributes['url']); |
|
| 244 | + } elseif (isset($attributes['route'])) { |
|
| 245 | + $this->route(...Arr::wrap($attributes['route'])); |
|
| 246 | + } elseif (isset($attributes['action'])) { |
|
| 247 | + $this->action(...Arr::wrap($attributes['action'])); |
|
| 248 | + } else { |
|
| 249 | + $this->setUrl('#'); |
|
| 250 | + } |
|
| 250 | 251 | } |
| 251 | 252 | |
| 252 | 253 | /** |
@@ -74,8 +74,7 @@ |
||
| 74 | 74 | foreach ($items as $item) { |
| 75 | 75 | if (is_array($item)) { |
| 76 | 76 | $this->items->pushSidebarItem($item); |
| 77 | - } |
|
| 78 | - elseif (config()->has($item)) { |
|
| 77 | + } elseif (config()->has($item)) { |
|
| 79 | 78 | $this->loadFromConfig(config()->get($item)); |
| 80 | 79 | } |
| 81 | 80 | } |
@@ -125,8 +125,9 @@ |
||
| 125 | 125 | */ |
| 126 | 126 | protected function getRetryTime($retry) |
| 127 | 127 | { |
| 128 | - if (is_numeric($retry) && $retry > 0) |
|
| 129 | - return (int) $retry; |
|
| 128 | + if (is_numeric($retry) && $retry > 0) { |
|
| 129 | + return (int) $retry; |
|
| 130 | + } |
|
| 130 | 131 | |
| 131 | 132 | return null; |
| 132 | 133 | } |
@@ -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 | } |
@@ -117,8 +117,9 @@ discard block |
||
| 117 | 117 | { |
| 118 | 118 | $this->authorize(LogViewerPolicy::ability('delete')); |
| 119 | 119 | |
| 120 | - if ( ! $this->logViewer->delete($date)) |
|
| 121 | - return $this->jsonResponseError(); |
|
| 120 | + if ( ! $this->logViewer->delete($date)) { |
|
| 121 | + return $this->jsonResponseError(); |
|
| 122 | + } |
|
| 122 | 123 | |
| 123 | 124 | $this->notifySuccess(__('Log Deleted'), __('The log file has been successfully deleted!')); |
| 124 | 125 | |
@@ -164,8 +165,7 @@ discard block |
||
| 164 | 165 | { |
| 165 | 166 | try { |
| 166 | 167 | return $this->logViewer->get($date); |
| 167 | - } |
|
| 168 | - catch (LogNotFoundException $e) { |
|
| 168 | + } catch (LogNotFoundException $e) { |
|
| 169 | 169 | abort(404, $e->getMessage()); |
| 170 | 170 | } |
| 171 | 171 | |
@@ -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) |
@@ -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(); |
@@ -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; |
@@ -56,11 +56,13 @@ discard block |
||
| 56 | 56 | { |
| 57 | 57 | $user = $request->user(); |
| 58 | 58 | |
| 59 | - if (is_null($user)) |
|
| 60 | - return false; |
|
| 59 | + if (is_null($user)) { |
|
| 60 | + return false; |
|
| 61 | + } |
|
| 61 | 62 | |
| 62 | - if ( ! $user instanceof MustVerifyEmail) |
|
| 63 | - return false; |
|
| 63 | + if ( ! $user instanceof MustVerifyEmail) { |
|
| 64 | + return false; |
|
| 65 | + } |
|
| 64 | 66 | |
| 65 | 67 | return ! $user->hasVerifiedEmail(); |
| 66 | 68 | } |
@@ -75,8 +77,9 @@ discard block |
||
| 75 | 77 | */ |
| 76 | 78 | protected function getMustBeVerifiedResponse(Request $request, string $redirectToRoute) |
| 77 | 79 | { |
| 78 | - if ($request->expectsJson()) |
|
| 79 | - abort(Response::HTTP_FORBIDDEN, 'Your email address is not verified.'); |
|
| 80 | + if ($request->expectsJson()) { |
|
| 81 | + abort(Response::HTTP_FORBIDDEN, 'Your email address is not verified.'); |
|
| 82 | + } |
|
| 80 | 83 | |
| 81 | 84 | return redirect()->route($redirectToRoute); |
| 82 | 85 | } |