@@ -98,8 +98,9 @@ |
||
| 98 | 98 | { |
| 99 | 99 | $categories = []; |
| 100 | 100 | |
| 101 | - foreach (explode(',', $this->attributes['categories']) as $articleCategory) |
|
| 102 | - $categories[] = ArticleCategory::query()->where('link', $articleCategory)->first(); |
|
| 101 | + foreach (explode(',', $this->attributes['categories']) as $articleCategory) { |
|
| 102 | + $categories[] = ArticleCategory::query()->where('link', $articleCategory)->first(); |
|
| 103 | + } |
|
| 103 | 104 | |
| 104 | 105 | return $categories; |
| 105 | 106 | } |
@@ -67,8 +67,9 @@ |
||
| 67 | 67 | { |
| 68 | 68 | $paymentMethods = []; |
| 69 | 69 | |
| 70 | - foreach (PaymentCategory::where('country_code', $countryCode)->get(['payment_type']) as $paymentMethod) |
|
| 71 | - $paymentMethods[] = $paymentMethod->payment_type; |
|
| 70 | + foreach (PaymentCategory::where('country_code', $countryCode)->get(['payment_type']) as $paymentMethod) { |
|
| 71 | + $paymentMethods[] = $paymentMethod->payment_type; |
|
| 72 | + } |
|
| 72 | 73 | |
| 73 | 74 | $this->paymentCategories = $paymentMethods; |
| 74 | 75 | } |
@@ -50,8 +50,9 @@ |
||
| 50 | 50 | */ |
| 51 | 51 | public function render($request, Exception $e) |
| 52 | 52 | { |
| 53 | - if ($e instanceof NotFoundHttpException) |
|
| 54 | - return response(view('habbo-web')); |
|
| 53 | + if ($e instanceof NotFoundHttpException) { |
|
| 54 | + return response(view('habbo-web')); |
|
| 55 | + } |
|
| 55 | 56 | |
| 56 | 57 | return parent::render($request, $e); |
| 57 | 58 | } |
@@ -94,8 +94,9 @@ |
||
| 94 | 94 | { |
| 95 | 95 | $groups = GroupMember::where('user_id', $this->user->uniqueId)->get() ?? []; |
| 96 | 96 | |
| 97 | - foreach ($groups as $group) |
|
| 98 | - $this->groups[] = $group->guild; |
|
| 97 | + foreach ($groups as $group) { |
|
| 98 | + $this->groups[] = $group->guild; |
|
| 99 | + } |
|
| 99 | 100 | } |
| 100 | 101 | |
| 101 | 102 | /** |
@@ -183,7 +183,7 @@ |
||
| 183 | 183 | * Confirm User Change Password |
| 184 | 184 | * |
| 185 | 185 | * @param Request $request |
| 186 | - * @return mixed |
|
| 186 | + * @return JsonResponse |
|
| 187 | 187 | */ |
| 188 | 188 | public function confirmChangePassword(Request $request): JsonResponse |
| 189 | 189 | { |
@@ -29,8 +29,9 @@ discard block |
||
| 29 | 29 | */ |
| 30 | 30 | public function featureStatus(Request $request): Response |
| 31 | 31 | { |
| 32 | - if ($request->user()->emailVerified == false) |
|
| 33 | - return response('identity_verification_required', 200); |
|
| 32 | + if ($request->user()->emailVerified == false) { |
|
| 33 | + return response('identity_verification_required', 200); |
|
| 34 | + } |
|
| 34 | 35 | |
| 35 | 36 | $featureEnabled = UserSecurity::find($request->user()->uniqueId); |
| 36 | 37 | |
@@ -45,8 +46,9 @@ discard block |
||
| 45 | 46 | */ |
| 46 | 47 | public function saveQuestions(Request $request): JsonResponse |
| 47 | 48 | { |
| 48 | - if (User::where('password', hash(Config::get('chocolatey.security.hash'), $request->json()->get('password')))->count() == 0) |
|
| 49 | - return response()->json(['error' => 'invalid_password'], 400); |
|
| 49 | + if (User::where('password', hash(Config::get('chocolatey.security.hash'), $request->json()->get('password')))->count() == 0) { |
|
| 50 | + return response()->json(['error' => 'invalid_password'], 400); |
|
| 51 | + } |
|
| 50 | 52 | |
| 51 | 53 | UserSecurity::updateOrCreate([ |
| 52 | 54 | 'user_id' => $request->user()->uniqueId, |
@@ -94,8 +96,9 @@ discard block |
||
| 94 | 96 | */ |
| 95 | 97 | public function changePassword(Request $request): JsonResponse |
| 96 | 98 | { |
| 97 | - if (strlen($request->json()->get('password')) < 6) |
|
| 98 | - return response()->json(['error' => 'password.current_password.invalid'], 409); |
|
| 99 | + if (strlen($request->json()->get('password')) < 6) { |
|
| 100 | + return response()->json(['error' => 'password.current_password.invalid'], 409); |
|
| 101 | + } |
|
| 99 | 102 | |
| 100 | 103 | UserFacade::updateUser(['password' => hash(Config::get('chocolatey.security.hash'), $request->json()->get('password'))]); |
| 101 | 104 | |
@@ -110,11 +113,13 @@ discard block |
||
| 110 | 113 | */ |
| 111 | 114 | public function changeMail(Request $request): JsonResponse |
| 112 | 115 | { |
| 113 | - if (User::where('password', hash(Config::get('chocolatey.security.hash'), $request->json()->get('currentPassword')))->count() == 0) |
|
| 114 | - return response()->json(['error' => 'changeEmail.invalid_password'], 400); |
|
| 116 | + if (User::where('password', hash(Config::get('chocolatey.security.hash'), $request->json()->get('currentPassword')))->count() == 0) { |
|
| 117 | + return response()->json(['error' => 'changeEmail.invalid_password'], 400); |
|
| 118 | + } |
|
| 115 | 119 | |
| 116 | - if (ChocolateyId::where('mail', $request->json()->get('newEmail'))->count() > 0) |
|
| 117 | - return response()->json(['error' => 'changeEmail.email_already_in_use'], 400); |
|
| 120 | + if (ChocolateyId::where('mail', $request->json()->get('newEmail'))->count() > 0) { |
|
| 121 | + return response()->json(['error' => 'changeEmail.email_already_in_use'], 400); |
|
| 122 | + } |
|
| 118 | 123 | |
| 119 | 124 | $this->sendChangeMailConfirmation($request); |
| 120 | 125 | |
@@ -148,8 +153,9 @@ discard block |
||
| 148 | 153 | */ |
| 149 | 154 | public function getQuestions(Request $request): JsonResponse |
| 150 | 155 | { |
| 151 | - if (UserSecurity::find($request->user()->uniqueId) == null) |
|
| 152 | - return response()->json(''); |
|
| 156 | + if (UserSecurity::find($request->user()->uniqueId) == null) { |
|
| 157 | + return response()->json(''); |
|
| 158 | + } |
|
| 153 | 159 | |
| 154 | 160 | $userSecurity = UserSecurity::find($request->user()->uniqueId); |
| 155 | 161 | |
@@ -172,8 +178,9 @@ discard block |
||
| 172 | 178 | $questions = UserSecurity::find($request->user()->uniqueId); |
| 173 | 179 | |
| 174 | 180 | if ($questions->firstAnswer == $request->json()->get('answer1') && $questions->secondAnswer == $request->json()->get('answer2')): |
| 175 | - if ($request->json()->get('trust') == true) |
|
| 176 | - (new TrustedDevice)->store($request->user()->uniqueId, $request->ip())->save(); |
|
| 181 | + if ($request->json()->get('trust') == true) { |
|
| 182 | + (new TrustedDevice)->store($request->user()->uniqueId, $request->ip())->save(); |
|
| 183 | + } |
|
| 177 | 184 | |
| 178 | 185 | return response()->json(null, 204); |
| 179 | 186 | endif; |
@@ -189,8 +196,9 @@ discard block |
||
| 189 | 196 | */ |
| 190 | 197 | public function confirmChangePassword(Request $request): JsonResponse |
| 191 | 198 | { |
| 192 | - if (Mail::getByToken($request->json()->get('token')) == null) |
|
| 193 | - return response()->json(null, 404); |
|
| 199 | + if (Mail::getByToken($request->json()->get('token')) == null) { |
|
| 200 | + return response()->json(null, 404); |
|
| 201 | + } |
|
| 194 | 202 | |
| 195 | 203 | UserFacade::updateData(User::where('mail', Mail::getMail()->mail), ['password' => hash(Config::get('chocolatey.security.hash'), $request->json()->get('password'))]); |
| 196 | 204 | |
@@ -14,7 +14,7 @@ |
||
| 14 | 14 | public function register() |
| 15 | 15 | { |
| 16 | 16 | // Register Mailing Services |
| 17 | - $this->app->singleton('mailer', function ($app) { |
|
| 17 | + $this->app->singleton('mailer', function($app) { |
|
| 18 | 18 | return $app->loadComponent('mail', 'Illuminate\Mail\MailServiceProvider', 'mailer'); |
| 19 | 19 | }); |
| 20 | 20 | } |
@@ -68,7 +68,7 @@ |
||
| 68 | 68 | public function getTrustedDevicesAttribute(): array |
| 69 | 69 | { |
| 70 | 70 | return TrustedDevice::where('user_id', $this->attributes['user_id'])->get(['ip_address']) |
| 71 | - ->map(function ($item) { |
|
| 71 | + ->map(function($item) { |
|
| 72 | 72 | return $item->ip_address; |
| 73 | 73 | })->toArray(); |
| 74 | 74 | } |
@@ -93,8 +93,9 @@ discard block |
||
| 93 | 93 | { |
| 94 | 94 | $paymentMethods = []; |
| 95 | 95 | |
| 96 | - if (!array_key_exists('payment_methods', $this->attributes)) |
|
| 97 | - return $paymentMethods; |
|
| 96 | + if (!array_key_exists('payment_methods', $this->attributes)) { |
|
| 97 | + return $paymentMethods; |
|
| 98 | + } |
|
| 98 | 99 | |
| 99 | 100 | foreach (explode(',', $this->attributes['payment_methods']) as $shopCategory): |
| 100 | 101 | $paymentMethod = PaymentMethod::where('localizationKey', $shopCategory)->first(); |
@@ -115,8 +116,9 @@ discard block |
||
| 115 | 116 | { |
| 116 | 117 | $shopCategories = []; |
| 117 | 118 | |
| 118 | - foreach (explode(',', $this->attributes['categories']) as $shopCategory) |
|
| 119 | - $shopCategories[] = ShopCategory::find($shopCategory)->category; |
|
| 119 | + foreach (explode(',', $this->attributes['categories']) as $shopCategory) { |
|
| 120 | + $shopCategories[] = ShopCategory::find($shopCategory)->category; |
|
| 121 | + } |
|
| 120 | 122 | |
| 121 | 123 | return $shopCategories; |
| 122 | 124 | } |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | */ |
| 19 | 19 | public function register() |
| 20 | 20 | { |
| 21 | - $this->app->bind('chocosession', function () { |
|
| 21 | + $this->app->bind('chocosession', function() { |
|
| 22 | 22 | return Session::getInstance(); |
| 23 | 23 | }); |
| 24 | 24 | |