@@ -80,8 +80,9 @@ |
||
80 | 80 | */ |
81 | 81 | public function hasValidCode(): bool |
82 | 82 | { |
83 | - if (is_null($this->code)) |
|
84 | - return false; |
|
83 | + if (is_null($this->code)) { |
|
84 | + return false; |
|
85 | + } |
|
85 | 86 | |
86 | 87 | $secret = $this->twoFactor()->decrypted_secret; |
87 | 88 |
@@ -97,8 +97,9 @@ discard block |
||
97 | 97 | */ |
98 | 98 | protected function shouldUseTwoFactor($user): bool |
99 | 99 | { |
100 | - if ( ! Auth::isTwoFactorEnabled()) |
|
101 | - return false; |
|
100 | + if ( ! Auth::isTwoFactorEnabled()) { |
|
101 | + return false; |
|
102 | + } |
|
102 | 103 | |
103 | 104 | return optional($user)->isTwoFactorEnabled() |
104 | 105 | && in_array(HasTwoFactorAuthentication::class, class_uses_recursive($user)); |
@@ -140,8 +141,9 @@ discard block |
||
140 | 141 | */ |
141 | 142 | protected function twoFactorChallengeResponse(Request $request, $user) |
142 | 143 | { |
143 | - if ($request->wantsJson()) |
|
144 | - return new JsonResponse(['two_factor' => true]); |
|
144 | + if ($request->wantsJson()) { |
|
145 | + return new JsonResponse(['two_factor' => true]); |
|
146 | + } |
|
145 | 147 | |
146 | 148 | return redirect()->to($this->getTwoFactorUrl($request)); |
147 | 149 | } |
@@ -27,7 +27,7 @@ |
||
27 | 27 | protected function moduleGroup(Closure $callback) |
28 | 28 | { |
29 | 29 | $this->prefix('system') |
30 | - ->name('system.') |
|
31 | - ->group($callback); |
|
30 | + ->name('system.') |
|
31 | + ->group($callback); |
|
32 | 32 | } |
33 | 33 | } |
@@ -58,7 +58,7 @@ |
||
58 | 58 | */ |
59 | 59 | public function compose(View $view): void |
60 | 60 | { |
61 | - $metrics = $this->manager->makeSelected()->filter(function ($metric) { |
|
61 | + $metrics = $this->manager->makeSelected()->filter(function($metric) { |
|
62 | 62 | return $metric->authorizedToSee(request()); |
63 | 63 | }); |
64 | 64 |
@@ -206,17 +206,21 @@ |
||
206 | 206 | */ |
207 | 207 | public function passes($attribute, $value): bool |
208 | 208 | { |
209 | - if ($this->requireUppercase && Str::lower($value) === $value) |
|
210 | - return $this->fail('The :attribute must contain at least one uppercase character.'); |
|
209 | + if ($this->requireUppercase && Str::lower($value) === $value) { |
|
210 | + return $this->fail('The :attribute must contain at least one uppercase character.'); |
|
211 | + } |
|
211 | 212 | |
212 | - if ($this->requireNumeric && ! preg_match('/[0-9]/', $value)) |
|
213 | - return $this->fail('The :attribute must contain at least one number.'); |
|
213 | + if ($this->requireNumeric && ! preg_match('/[0-9]/', $value)) { |
|
214 | + return $this->fail('The :attribute must contain at least one number.'); |
|
215 | + } |
|
214 | 216 | |
215 | - if ($this->requireSpecialCharacter && ! preg_match('/[\W_]/', $value)) |
|
216 | - return $this->fail('The :attribute must contain at least one special character.'); |
|
217 | + if ($this->requireSpecialCharacter && ! preg_match('/[\W_]/', $value)) { |
|
218 | + return $this->fail('The :attribute must contain at least one special character.'); |
|
219 | + } |
|
217 | 220 | |
218 | - if (Str::length($value) < $this->length) |
|
219 | - return $this->fail("The :attribute must be at least {$this->length} characters."); |
|
221 | + if (Str::length($value) < $this->length) { |
|
222 | + return $this->fail("The :attribute must be at least {$this->length} characters."); |
|
223 | + } |
|
220 | 224 | |
221 | 225 | return true; |
222 | 226 | } |
@@ -33,8 +33,9 @@ |
||
33 | 33 | */ |
34 | 34 | public function __construct(string $label = null) |
35 | 35 | { |
36 | - if ( ! empty($label)) |
|
37 | - $this->label = __($label); |
|
36 | + if ( ! empty($label)) { |
|
37 | + $this->label = __($label); |
|
38 | + } |
|
38 | 39 | } |
39 | 40 | |
40 | 41 | /* ----------------------------------------------------------------- |
@@ -53,7 +53,7 @@ |
||
53 | 53 | string $id = null, |
54 | 54 | $value = null, |
55 | 55 | ?string $label = null |
56 | - ){ |
|
56 | + ) { |
|
57 | 57 | |
58 | 58 | $this->options = $options; |
59 | 59 | $this->name = $name; |
@@ -61,12 +61,12 @@ |
||
61 | 61 | */ |
62 | 62 | private function registerBladeComponents(): void |
63 | 63 | { |
64 | - $this->callAfterResolving(BladeCompiler::class, function (BladeCompiler $blade, $app) { |
|
64 | + $this->callAfterResolving(BladeCompiler::class, function(BladeCompiler $blade, $app) { |
|
65 | 65 | $prefix = $app['config']->get('arcanesoft.foundation.view.prefix', ''); |
66 | 66 | $components = $app['config']->get('arcanesoft.foundation.view.components', []); |
67 | 67 | |
68 | 68 | $blade->components( |
69 | - Collection::make($components)->mapWithKeys(function ($component, $key) use ($prefix) { |
|
69 | + Collection::make($components)->mapWithKeys(function($component, $key) use ($prefix) { |
|
70 | 70 | return ["{$prefix}{$key}" => $component]; |
71 | 71 | })->toArray() |
72 | 72 | ); |
@@ -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 |