@@ -27,7 +27,7 @@ |
||
| 27 | 27 | public function boot() |
| 28 | 28 | { |
| 29 | 29 | Paginator::useBootstrap(); |
| 30 | - Validator::extend('isunique', function ($attribute, $value, $parameters, $validator) { |
|
| 30 | + Validator::extend('isunique', function($attribute, $value, $parameters, $validator) { |
|
| 31 | 31 | $value = strtolower($value); |
| 32 | 32 | $query = DB::table($parameters[0])->whereRaw("LOWER({$attribute}) = ?", [$value]); |
| 33 | 33 | |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | { |
| 38 | 38 | $this->configureRateLimiting(); |
| 39 | 39 | |
| 40 | - $this->routes(function () { |
|
| 40 | + $this->routes(function() { |
|
| 41 | 41 | Route::prefix('api') |
| 42 | 42 | ->middleware('api') |
| 43 | 43 | ->namespace($this->namespace) |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | */ |
| 57 | 57 | protected function configureRateLimiting() |
| 58 | 58 | { |
| 59 | - RateLimiter::for('api', function (Request $request) { |
|
| 59 | + RateLimiter::for ('api', function(Request $request) { |
|
| 60 | 60 | return Limit::perMinute(60)->by(optional($request->user())->id ?: $request->ip()); |
| 61 | 61 | }); |
| 62 | 62 | } |
@@ -34,7 +34,7 @@ |
||
| 34 | 34 | */ |
| 35 | 35 | protected function commands() |
| 36 | 36 | { |
| 37 | - $this->load(__DIR__.'/Commands'); |
|
| 37 | + $this->load(__DIR__ . '/Commands'); |
|
| 38 | 38 | |
| 39 | 39 | require base_path('routes/console.php'); |
| 40 | 40 | } |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | { |
| 62 | 62 | for ($c = 0; $c < strlen($b) - 2; $c += 3) { |
| 63 | 63 | $d = $b[$c + 2]; |
| 64 | - $d = $d >= 'a' ? ord($d[0]) - 87 : (int) $d; |
|
| 64 | + $d = $d >= 'a' ? ord($d[0]) - 87 : (int)$d; |
|
| 65 | 65 | $d = $b[$c + 1] === '+' ? $this->unsignedRightShift($a, $d) : $a << $d; |
| 66 | 66 | $a = $b[$c] === '+' ? ($a + $d & 4294967295) : $a ^ $d; |
| 67 | 67 | } |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | private function unsignedRightShift(int $a, int $b): int |
| 73 | 73 | { |
| 74 | 74 | if ($b >= 32 || $b < -32) { |
| 75 | - $m = (int) ($b / 32); |
|
| 75 | + $m = (int)($b / 32); |
|
| 76 | 76 | $b -= ($m * 32); |
| 77 | 77 | } |
| 78 | 78 | |
@@ -258,13 +258,13 @@ discard block |
||
| 258 | 258 | } |
| 259 | 259 | |
| 260 | 260 | if (is_array($responseArray[0])) { |
| 261 | - return (string) array_reduce($responseArray[0], static function ($carry, $item) { |
|
| 261 | + return (string)array_reduce($responseArray[0], static function($carry, $item) { |
|
| 262 | 262 | $carry .= $item[0]; |
| 263 | 263 | return $carry; |
| 264 | 264 | }); |
| 265 | 265 | } |
| 266 | 266 | |
| 267 | - return (string) $responseArray[0]; |
|
| 267 | + return (string)$responseArray[0]; |
|
| 268 | 268 | } |
| 269 | 269 | |
| 270 | 270 | public function getResponse(string $string): array |
@@ -307,7 +307,7 @@ discard block |
||
| 307 | 307 | |
| 308 | 308 | protected function isValidLocale(string $lang): bool |
| 309 | 309 | { |
| 310 | - return (bool) preg_match('/^([a-z]{2,3})(-[A-Za-z]{2,4})?$/', $lang); |
|
| 310 | + return (bool)preg_match('/^([a-z]{2,3})(-[A-Za-z]{2,4})?$/', $lang); |
|
| 311 | 311 | } |
| 312 | 312 | } |
| 313 | 313 | |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | |
| 48 | 48 | function analyzeImageBrightness($file) { |
| 49 | 49 | try { |
| 50 | - $file = base_path('assets/img/background-img/'.$file); |
|
| 50 | + $file = base_path('assets/img/background-img/' . $file); |
|
| 51 | 51 | |
| 52 | 52 | // Get image information using getimagesize |
| 53 | 53 | $imageInfo = getimagesize($file); |
@@ -77,8 +77,8 @@ discard block |
||
| 77 | 77 | |
| 78 | 78 | // Calculate the average brightness of the image |
| 79 | 79 | $total_brightness = 0; |
| 80 | - for ($x=0; $x<$width; $x++) { |
|
| 81 | - for ($y=0; $y<$height; $y++) { |
|
| 80 | + for ($x = 0; $x < $width; $x++) { |
|
| 81 | + for ($y = 0; $y < $height; $y++) { |
|
| 82 | 82 | $rgb = imagecolorat($img, $x, $y); |
| 83 | 83 | $r = ($rgb >> 16) & 0xFF; |
| 84 | 84 | $g = ($rgb >> 8) & 0xFF; |
@@ -132,10 +132,10 @@ discard block |
||
| 132 | 132 | function footer($key) |
| 133 | 133 | { |
| 134 | 134 | $upperStr = strtoupper($key); |
| 135 | - if (env('TITLE_FOOTER_'.$upperStr) == "") { |
|
| 136 | - $title = __('messages.footer.'.$key); |
|
| 135 | + if (env('TITLE_FOOTER_' . $upperStr) == "") { |
|
| 136 | + $title = __('messages.footer.' . $key); |
|
| 137 | 137 | } else { |
| 138 | - $title = env('TITLE_FOOTER_'.$upperStr); |
|
| 138 | + $title = env('TITLE_FOOTER_' . $upperStr); |
|
| 139 | 139 | } |
| 140 | 140 | return $title; |
| 141 | 141 | } |
| 142 | 142 | \ No newline at end of file |
@@ -15,7 +15,7 @@ |
||
| 15 | 15 | { |
| 16 | 16 | parent::boot(); |
| 17 | 17 | |
| 18 | - static::creating(function ($link) { |
|
| 18 | + static::creating(function($link) { |
|
| 19 | 19 | if (config('linkstack.disable_random_link_ids') != 'true') { |
| 20 | 20 | $numberOfDigits = config('linkstack.link_id_length') ?? 9; |
| 21 | 21 | |
@@ -61,7 +61,7 @@ |
||
| 61 | 61 | |
| 62 | 62 | private static function getCachedUserData($userId) |
| 63 | 63 | { |
| 64 | - return Cache::remember('user_data_' . $userId, now()->addMinutes(10), function () use ($userId) { |
|
| 64 | + return Cache::remember('user_data_' . $userId, now()->addMinutes(10), function() use ($userId) { |
|
| 65 | 65 | return self::where('id', $userId)->first(); |
| 66 | 66 | }); |
| 67 | 67 | } |
@@ -61,7 +61,7 @@ |
||
| 61 | 61 | { |
| 62 | 62 | parent::boot(); |
| 63 | 63 | |
| 64 | - static::creating(function ($user) { |
|
| 64 | + static::creating(function($user) { |
|
| 65 | 65 | if (config('linkstack.disable_random_user_ids') != 'true') { |
| 66 | 66 | if (is_null(User::first())) { |
| 67 | 67 | $user->id = 1; |
@@ -34,11 +34,11 @@ |
||
| 34 | 34 | */ |
| 35 | 35 | public function register() |
| 36 | 36 | { |
| 37 | - $this->reportable(function (Throwable $e) { |
|
| 37 | + $this->reportable(function(Throwable $e) { |
|
| 38 | 38 | // |
| 39 | 39 | }); |
| 40 | 40 | |
| 41 | - $this->renderable(function (\Exception $e) { |
|
| 41 | + $this->renderable(function(\Exception $e) { |
|
| 42 | 42 | if ($e->getPrevious() instanceof \Illuminate\Session\TokenMismatchException) { |
| 43 | 43 | return redirect()->route('login'); |
| 44 | 44 | }; |