@@ -205,8 +205,9 @@ discard block |
||
205 | 205 | */ |
206 | 206 | public function delete(Administrator $administrator, User $user = null) |
207 | 207 | { |
208 | - if ( ! is_null($user)) |
|
209 | - return $user->isDeletable(); |
|
208 | + if ( ! is_null($user)) { |
|
209 | + return $user->isDeletable(); |
|
210 | + } |
|
210 | 211 | } |
211 | 212 | |
212 | 213 | /** |
@@ -219,8 +220,9 @@ discard block |
||
219 | 220 | */ |
220 | 221 | public function forceDelete(Administrator $administrator, User $user = null) |
221 | 222 | { |
222 | - if ( ! is_null($user)) |
|
223 | - return $user->isDeletable(); |
|
223 | + if ( ! is_null($user)) { |
|
224 | + return $user->isDeletable(); |
|
225 | + } |
|
224 | 226 | } |
225 | 227 | |
226 | 228 | /** |
@@ -169,8 +169,9 @@ |
||
169 | 169 | { |
170 | 170 | $emails = (array) static::config('administrators.emails'); |
171 | 171 | |
172 | - if (empty($emails)) |
|
173 | - return false; |
|
172 | + if (empty($emails)) { |
|
173 | + return false; |
|
174 | + } |
|
174 | 175 | |
175 | 176 | return in_array($user->email, $emails); |
176 | 177 | } |
@@ -34,7 +34,7 @@ |
||
34 | 34 | public function calculate(Request $request, RolesRepository $repo) |
35 | 35 | { |
36 | 36 | // Calculate roles with users count |
37 | - $result = $repo->withCount(['administrators'])->get()->filter(function ($role) { |
|
37 | + $result = $repo->withCount(['administrators'])->get()->filter(function($role) { |
|
38 | 38 | return $role->administrators_count > 0; |
39 | 39 | })->pluck('administrators_count', 'name'); |
40 | 40 |
@@ -105,11 +105,11 @@ |
||
105 | 105 | */ |
106 | 106 | protected function registerModuleManifest(): void |
107 | 107 | { |
108 | - $this->singleton(PackageManifest::class, function (Application $app) { |
|
108 | + $this->singleton(PackageManifest::class, function(Application $app) { |
|
109 | 109 | return new PackageManifest(new Filesystem, $app->basePath()); |
110 | 110 | }); |
111 | 111 | |
112 | - $this->singleton(ModuleManifest::class, function (Application $app) { |
|
112 | + $this->singleton(ModuleManifest::class, function(Application $app) { |
|
113 | 113 | return new ModuleManifest( |
114 | 114 | new Filesystem, $app->basePath(), $app->bootstrapPath(Arcanesoft::ARCANESOFT_MODULES_CACHE) |
115 | 115 | ); |
@@ -288,7 +288,7 @@ |
||
288 | 288 | */ |
289 | 289 | protected function checkCanSeeChildren($administrator): bool |
290 | 290 | { |
291 | - return $this->children->filter(function (Item $child) use ($administrator) { |
|
291 | + return $this->children->filter(function(Item $child) use ($administrator) { |
|
292 | 292 | return $child->canSee($administrator); |
293 | 293 | })->isNotEmpty(); |
294 | 294 | } |
@@ -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 | } |
@@ -45,7 +45,7 @@ |
||
45 | 45 | |
46 | 46 | static::bindRouteClasses($routes); |
47 | 47 | |
48 | - $this->routes(function () use ($routes) { |
|
48 | + $this->routes(function() use ($routes) { |
|
49 | 49 | static::mapRouteClasses($routes); |
50 | 50 | }); |
51 | 51 | } |
@@ -68,9 +68,9 @@ discard block |
||
68 | 68 | protected function adminGroup(Closure $callback): void |
69 | 69 | { |
70 | 70 | $this->prefix($this->getAdminPrefix()) |
71 | - ->middleware($this->getAdminMiddleware()) |
|
72 | - ->name($this->getAdminName()) |
|
73 | - ->group($this->prepareModuleCallback($callback)); |
|
71 | + ->middleware($this->getAdminMiddleware()) |
|
72 | + ->name($this->getAdminName()) |
|
73 | + ->group($this->prepareModuleCallback($callback)); |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | /** |
@@ -82,9 +82,9 @@ discard block |
||
82 | 82 | { |
83 | 83 | $this->adminGroup(function () use ($callback) { |
84 | 84 | $this->prefix('api') |
85 | - ->name('api.') |
|
86 | - ->middleware(['ajax']) |
|
87 | - ->group($callback); |
|
85 | + ->name('api.') |
|
86 | + ->middleware(['ajax']) |
|
87 | + ->group($callback); |
|
88 | 88 | }); |
89 | 89 | } |
90 | 90 |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | */ |
81 | 81 | protected function adminApiGroup(Closure $callback): void |
82 | 82 | { |
83 | - $this->adminGroup(function () use ($callback) { |
|
83 | + $this->adminGroup(function() use ($callback) { |
|
84 | 84 | $this->prefix('api') |
85 | 85 | ->name('api.') |
86 | 86 | ->middleware(['ajax']) |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | private function prepareModuleCallback(Closure $callback): Closure |
99 | 99 | { |
100 | 100 | return method_exists($this, 'moduleGroup') |
101 | - ? function () use ($callback) { $this->moduleGroup($callback); } |
|
101 | + ? function() use ($callback) { $this->moduleGroup($callback); } |
|
102 | 102 | : $callback; |
103 | 103 | } |
104 | 104 | } |