@@ -18,7 +18,7 @@ |
||
| 18 | 18 | */ |
| 19 | 19 | public function register() |
| 20 | 20 | { |
| 21 | - $this->app->bind('azuresession', function () { |
|
| 21 | + $this->app->bind('azuresession', function() { |
|
| 22 | 22 | return Session::getInstance(); |
| 23 | 23 | }); |
| 24 | 24 | |
@@ -21,7 +21,7 @@ |
||
| 21 | 21 | */ |
| 22 | 22 | public function boot() |
| 23 | 23 | { |
| 24 | - $this->app['auth']->viaRequest('api', function ($request) { |
|
| 24 | + $this->app['auth']->viaRequest('api', function($request) { |
|
| 25 | 25 | $userData = Session::has('ChocolateyWEB') ? Session::get('ChocolateyWEB') : null; |
| 26 | 26 | |
| 27 | 27 | return $request->path() == 'api/public/authentication/login' |
@@ -233,8 +233,9 @@ |
||
| 233 | 233 | */ |
| 234 | 234 | public function getTrustedAttribute(): bool |
| 235 | 235 | { |
| 236 | - if (UserSecurity::find($this->attributes['id']) == null) |
|
| 237 | - return true; |
|
| 236 | + if (UserSecurity::find($this->attributes['id']) == null) { |
|
| 237 | + return true; |
|
| 238 | + } |
|
| 238 | 239 | |
| 239 | 240 | return in_array($this->trusted, UserSecurity::find($this->attributes['id'])->trustedDevices); |
| 240 | 241 | } |
@@ -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 | } |
@@ -88,7 +88,7 @@ |
||
| 88 | 88 | * |
| 89 | 89 | * @return User |
| 90 | 90 | */ |
| 91 | - protected function getUserFriendData(): ?User |
|
| 91 | + protected function getUserFriendData(): ? User |
|
| 92 | 92 | { |
| 93 | 93 | return User::find($this->attributes['user_two_id']); |
| 94 | 94 | } |
@@ -52,11 +52,13 @@ |
||
| 52 | 52 | */ |
| 53 | 53 | public function register(Request $request): JsonResponse |
| 54 | 54 | { |
| 55 | - if (strpos($request->json()->get('email'), '@') == false) |
|
| 56 | - return response()->json(['error' => 'registration_email'], 409); |
|
| 55 | + if (strpos($request->json()->get('email'), '@') == false) { |
|
| 56 | + return response()->json(['error' => 'registration_email'], 409); |
|
| 57 | + } |
|
| 57 | 58 | |
| 58 | - if (ChocolateyId::query()->where('mail', $request->json()->get('email'))->count() > 0) |
|
| 59 | - return response()->json(['error' => 'registration_email_in_use'], 409); |
|
| 59 | + if (ChocolateyId::query()->where('mail', $request->json()->get('email'))->count() > 0) { |
|
| 60 | + return response()->json(['error' => 'registration_email_in_use'], 409); |
|
| 61 | + } |
|
| 60 | 62 | |
| 61 | 63 | $userData = (new AccountController) |
| 62 | 64 | ->createUser($request, $request->json()->all(), true); |
@@ -98,8 +98,9 @@ |
||
| 98 | 98 | { |
| 99 | 99 | $shopCategories = []; |
| 100 | 100 | |
| 101 | - foreach (explode(',', $this->attributes['categories']) as $shopCategory) |
|
| 102 | - $shopCategories[] = ShopCategory::find($shopCategory)->category; |
|
| 101 | + foreach (explode(',', $this->attributes['categories']) as $shopCategory) { |
|
| 102 | + $shopCategories[] = ShopCategory::find($shopCategory)->category; |
|
| 103 | + } |
|
| 103 | 104 | |
| 104 | 105 | return $shopCategories; |
| 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 | } |
@@ -54,8 +54,9 @@ discard block |
||
| 54 | 54 | */ |
| 55 | 55 | public function likePhoto(Request $request, $photoId): JsonResponse |
| 56 | 56 | { |
| 57 | - if (PhotoLike::where('username', $request->user()->name)->where('photo_id', $photoId)->count() > 0) |
|
| 58 | - return response()->json(''); |
|
| 57 | + if (PhotoLike::where('username', $request->user()->name)->where('photo_id', $photoId)->count() > 0) { |
|
| 58 | + return response()->json(''); |
|
| 59 | + } |
|
| 59 | 60 | |
| 60 | 61 | (new PhotoLike)->store($photoId, $request->user()->name)->save(); |
| 61 | 62 | |
@@ -71,8 +72,9 @@ discard block |
||
| 71 | 72 | */ |
| 72 | 73 | public function unlikePhoto(Request $request, $photoId): JsonResponse |
| 73 | 74 | { |
| 74 | - if (PhotoLike::where('username', $request->user()->name)->where('photo_id', $photoId)->count() == 0) |
|
| 75 | - return response()->json(''); |
|
| 75 | + if (PhotoLike::where('username', $request->user()->name)->where('photo_id', $photoId)->count() == 0) { |
|
| 76 | + return response()->json(''); |
|
| 77 | + } |
|
| 76 | 78 | |
| 77 | 79 | PhotoLike::where('username', $request->user()->name)->where('photo_id', $photoId)->delete(); |
| 78 | 80 | |