@@ -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, |
@@ -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 | } |
@@ -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 | } |
@@ -77,13 +77,13 @@ |
||
77 | 77 | { |
78 | 78 | return $repo |
79 | 79 | ->onlyTrashed($this->trash) |
80 | - ->unless(empty($this->search), function (Builder $query) { |
|
80 | + ->unless(empty($this->search), function(Builder $query) { |
|
81 | 81 | $query |
82 | 82 | ->where('first_name', 'like', '%'.$this->search.'%') |
83 | 83 | ->orWhere('last_name', 'like', '%'.$this->search.'%') |
84 | 84 | ->orWhere('email', 'like', '%'.$this->search.'%'); |
85 | 85 | }) |
86 | - ->unless(empty($this->sortField), function (Builder $query) { |
|
86 | + ->unless(empty($this->sortField), function(Builder $query) { |
|
87 | 87 | $query->orderBy($this->sortField, $this->getSortDirection()); |
88 | 88 | }) |
89 | 89 | ->paginate($this->perPage); |
@@ -151,8 +151,9 @@ |
||
151 | 151 | public function getValidRecoveryCode(string $code) |
152 | 152 | { |
153 | 153 | foreach ($this->decrypted_recovery_codes as $recoveryCode) { |
154 | - if (hash_equals($code, $recoveryCode)) |
|
155 | - return $recoveryCode; |
|
154 | + if (hash_equals($code, $recoveryCode)) { |
|
155 | + return $recoveryCode; |
|
156 | + } |
|
156 | 157 | } |
157 | 158 | |
158 | 159 | return null; |