Passed
Push — main ( bdbaee...80491e )
by Julian
16:21 queued 10:39
created
app/Providers/RouteServiceProvider.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
app/Console/Kernel.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
app/Console/Commands/Translate.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
app/Functions/functions.php 2 patches
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
     // Get image information using getimagesize
53 53
     $imageInfo = getimagesize($file);
54 54
     if (!$imageInfo) {
55
-      return 'dark';
55
+        return 'dark';
56 56
     }
57 57
   
58 58
     // Get the image type
@@ -60,14 +60,14 @@  discard block
 block discarded – undo
60 60
   
61 61
     // Load the image based on its type
62 62
     switch ($type) {
63
-      case IMAGETYPE_JPEG:
63
+        case IMAGETYPE_JPEG:
64 64
       case IMAGETYPE_JPEG2000:
65 65
         $img = imagecreatefromjpeg($file);
66 66
         break;
67
-      case IMAGETYPE_PNG:
67
+        case IMAGETYPE_PNG:
68 68
         $img = imagecreatefrompng($file);
69 69
         break;
70
-      default:
70
+        default:
71 71
         return 'dark';
72 72
     }
73 73
   
@@ -78,29 +78,29 @@  discard block
 block discarded – undo
78 78
     // Calculate the average brightness of the image
79 79
     $total_brightness = 0;
80 80
     for ($x=0; $x<$width; $x++) {
81
-      for ($y=0; $y<$height; $y++) {
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;
85 85
         $b = $rgb & 0xFF;
86 86
         $brightness = (int)(($r + $g + $b) / 3);
87 87
         $total_brightness += $brightness;
88
-      }
88
+        }
89 89
     }
90 90
     $avg_brightness = $total_brightness / ($width * $height);
91 91
   
92 92
     // Determine if the image is more dark or light
93 93
     if ($avg_brightness < 128) {
94
-      return 'dark';
94
+        return 'dark';
95 95
     } else {
96
-      return 'light';
96
+        return 'light';
97
+    }
98
+        } catch (\Throwable $th) {
99
+            return null;
100
+        }
97 101
     }
98
-      } catch (\Throwable $th) {
99
-          return null;
100
-      }
101
-  }
102 102
   
103
-  function infoIcon($tip) {
103
+    function infoIcon($tip) {
104 104
     echo '
105 105
       <div class="d-flex justify-content-center align-items-center">
106 106
         <a data-bs-toggle="tooltip" data-bs-placement="bottom" title="' . $tip . '">
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
         </a>
111 111
       </div>
112 112
     ';
113
-  }
113
+    }
114 114
 
115 115
 function external_file_get_contents($url) {
116 116
     $ch = curl_init();
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
app/Models/Link.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
         parent::boot();
17 17
 
18 18
         static::creating(function ($link) {
19
-          if (config('linkstack.disable_random_link_ids') != 'true') {
19
+            if (config('linkstack.disable_random_link_ids') != 'true') {
20 20
             $numberOfDigits = config('linkstack.link_id_length') ?? 9;
21 21
 
22 22
             $minIdValue = 10**($numberOfDigits - 1);
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
             } while (Link::find($randomId));
28 28
 
29 29
             $link->id = $randomId;
30
-          }
30
+            }
31 31
         });
32 32
     }
33 33
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
app/Models/UserData.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
app/Models/User.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.
app/Exceptions/Handler.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -34,11 +34,11 @@
 block discarded – undo
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
             };
Please login to merge, or discard this patch.
app/Http/Controllers/AdminController.php 2 patches
Spacing   +51 added lines, -51 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
             'countries' => visits('App\Models\User', $littlelink_name)->countries(),
71 71
         ];
72 72
 
73
-        return view('panel/index', ['lastMonthCount' => $lastMonthCount,'lastWeekCount' => $lastWeekCount,'last24HrsCount' => $last24HrsCount,'updatedLast30DaysCount' => $updatedLast30DaysCount,'updatedLast7DaysCount' => $updatedLast7DaysCount,'updatedLast24HrsCount' => $updatedLast24HrsCount,'toplinks' => $topLinks, 'links' => $links, 'clicks' => $clicks, 'pageStats' => $pageStats, 'littlelink_name' => $littlelink_name, 'links' => $links, 'clicks' => $clicks, 'siteLinks' => $siteLinks, 'siteClicks' => $siteClicks, 'userNumber' => $userNumber]);
73
+        return view('panel/index', ['lastMonthCount' => $lastMonthCount, 'lastWeekCount' => $lastWeekCount, 'last24HrsCount' => $last24HrsCount, 'updatedLast30DaysCount' => $updatedLast30DaysCount, 'updatedLast7DaysCount' => $updatedLast7DaysCount, 'updatedLast24HrsCount' => $updatedLast24HrsCount, 'toplinks' => $topLinks, 'links' => $links, 'clicks' => $clicks, 'pageStats' => $pageStats, 'littlelink_name' => $littlelink_name, 'links' => $links, 'clicks' => $clicks, 'siteLinks' => $siteLinks, 'siteClicks' => $siteClicks, 'userNumber' => $userNumber]);
74 74
     }
75 75
 
76 76
 // Users page
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
         $userId = auth()->id();
87 87
         $user = User::findOrFail($userId);
88 88
         
89
-        Mail::send('auth.test', ['user' => $user], function ($message) use ($user) {
89
+        Mail::send('auth.test', ['user' => $user], function($message) use ($user) {
90 90
             $message->to($user->email)
91 91
                     ->subject('Test Email');
92 92
         });
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
 
130 130
         User::where('id', $id)->update(['role' => $verify]);
131 131
 
132
-        return redirect(url('u')."/".$id);
132
+        return redirect(url('u') . "/" . $id);
133 133
     }
134 134
 
135 135
     //Verify or un-verify users emails
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
         });
174 174
 
175 175
         $numbers = array_map(function($name) {
176
-            return (int) str_replace('Admin-Created-', '', $name);
176
+            return (int)str_replace('Admin-Created-', '', $name);
177 177
         }, $adminCreatedNames);
178 178
 
179 179
         $maxNumber = !empty($numbers) ? max($numbers) : 0;
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
         $customBackground = $request->file('background');
278 278
         $theme = $request->theme;
279 279
 
280
-        if(User::where('id', $id)->get('role')->first()->role =! $role) {
280
+        if (User::where('id', $id)->get('role')->first()->role = !$role) {
281 281
             if ($role == 'vip') {
282 282
                 UserData::saveData($id, 'checkmark', true);
283 283
             }
@@ -295,11 +295,11 @@  discard block
 block discarded – undo
295 295
             $directory = base_path('assets/img/background-img/');
296 296
             $files = scandir($directory);
297 297
             $pathinfo = "error.error";
298
-            foreach($files as $file) {
299
-            if (strpos($file, $id.'.') !== false) {
300
-            $pathinfo = $id. "." . pathinfo($file, PATHINFO_EXTENSION);
298
+            foreach ($files as $file) {
299
+            if (strpos($file, $id . '.') !== false) {
300
+            $pathinfo = $id . "." . pathinfo($file, PATHINFO_EXTENSION);
301 301
             }}
302
-            if(file_exists(base_path('assets/img/background-img/').$pathinfo)){File::delete(base_path('assets/img/background-img/').$pathinfo);}
302
+            if (file_exists(base_path('assets/img/background-img/') . $pathinfo)) {File::delete(base_path('assets/img/background-img/') . $pathinfo); }
303 303
     
304 304
             $customBackground->move(base_path('assets/img/background-img/'), $id . '_' . time() . "." . $request->file('background')->extension());
305 305
         } 
@@ -346,20 +346,20 @@  discard block
 block discarded – undo
346 346
         if (!empty($logo)) {
347 347
             // Delete existing image
348 348
             $path = findFile('avatar');
349
-            $path = base_path('/assets/linkstack/images/'.$path);
349
+            $path = base_path('/assets/linkstack/images/' . $path);
350 350
     
351 351
                 // Delete existing image
352 352
                 if (File::exists($path)) {
353 353
                     File::delete($path);
354 354
                 }
355 355
 
356
-            $logo->move(base_path('/assets/linkstack/images/'), "avatar" . '_' . time() . "." .$request->file('image')->extension());
356
+            $logo->move(base_path('/assets/linkstack/images/'), "avatar" . '_' . time() . "." . $request->file('image')->extension());
357 357
         }
358 358
 
359 359
         if (!empty($icon)) {
360 360
             // Delete existing image
361 361
             $path = findFile('favicon');
362
-            $path = base_path('/assets/linkstack/images/'.$path);
362
+            $path = base_path('/assets/linkstack/images/' . $path);
363 363
     
364 364
                 // Delete existing image
365 365
                 if (File::exists($path)) {
@@ -375,7 +375,7 @@  discard block
 block discarded – undo
375 375
     public function delAvatar()
376 376
     {
377 377
         $path = findFile('avatar');
378
-        $path = base_path('/assets/linkstack/images/'.$path);
378
+        $path = base_path('/assets/linkstack/images/' . $path);
379 379
 
380 380
             // Delete existing image
381 381
             if (File::exists($path)) {
@@ -390,7 +390,7 @@  discard block
 block discarded – undo
390 390
     {
391 391
             // Delete existing image
392 392
             $path = findFile('favicon');
393
-            $path = base_path('/assets/linkstack/images/'.$path);
393
+            $path = base_path('/assets/linkstack/images/' . $path);
394 394
     
395 395
                 // Delete existing image
396 396
                 if (File::exists($path)) {
@@ -624,46 +624,46 @@  discard block
 block discarded – undo
624 624
         $entry = $request->entry;
625 625
         $value = $request->value;
626 626
 
627
-        if($type === "toggle"){
628
-            if($request->toggle != ''){$value = "true";}else{$value = "false";}
629
-            if(EnvEditor::keyExists($entry)){EnvEditor::editKey($entry, $value);}
630
-        } elseif($type === "toggle2") {
631
-            if($request->toggle != ''){$value = "verified";}else{$value = "auth";}
632
-            if(EnvEditor::keyExists($entry)){EnvEditor::editKey($entry, $value);}
633
-        } elseif($type === "text") {
634
-            if(EnvEditor::keyExists($entry)){EnvEditor::editKey($entry, '"' . $value . '"');}
635
-        } elseif($type === "debug") {
636
-            if($request->toggle != ''){
637
-                if(EnvEditor::keyExists('APP_DEBUG')){EnvEditor::editKey('APP_DEBUG', 'true');}
638
-                if(EnvEditor::keyExists('APP_ENV')){EnvEditor::editKey('APP_ENV', 'local');}
639
-                if(EnvEditor::keyExists('LOG_LEVEL')){EnvEditor::editKey('LOG_LEVEL', 'debug');}
627
+        if ($type === "toggle") {
628
+            if ($request->toggle != '') {$value = "true"; } else {$value = "false"; }
629
+            if (EnvEditor::keyExists($entry)) {EnvEditor::editKey($entry, $value); }
630
+        } elseif ($type === "toggle2") {
631
+            if ($request->toggle != '') {$value = "verified"; } else {$value = "auth"; }
632
+            if (EnvEditor::keyExists($entry)) {EnvEditor::editKey($entry, $value); }
633
+        } elseif ($type === "text") {
634
+            if (EnvEditor::keyExists($entry)) {EnvEditor::editKey($entry, '"' . $value . '"'); }
635
+        } elseif ($type === "debug") {
636
+            if ($request->toggle != '') {
637
+                if (EnvEditor::keyExists('APP_DEBUG')) {EnvEditor::editKey('APP_DEBUG', 'true'); }
638
+                if (EnvEditor::keyExists('APP_ENV')) {EnvEditor::editKey('APP_ENV', 'local'); }
639
+                if (EnvEditor::keyExists('LOG_LEVEL')) {EnvEditor::editKey('LOG_LEVEL', 'debug'); }
640 640
             } else {
641
-                if(EnvEditor::keyExists('APP_DEBUG')){EnvEditor::editKey('APP_DEBUG', 'false');}
642
-                if(EnvEditor::keyExists('APP_ENV')){EnvEditor::editKey('APP_ENV', 'production');}
643
-                if(EnvEditor::keyExists('LOG_LEVEL')){EnvEditor::editKey('LOG_LEVEL', 'error');}
641
+                if (EnvEditor::keyExists('APP_DEBUG')) {EnvEditor::editKey('APP_DEBUG', 'false'); }
642
+                if (EnvEditor::keyExists('APP_ENV')) {EnvEditor::editKey('APP_ENV', 'production'); }
643
+                if (EnvEditor::keyExists('LOG_LEVEL')) {EnvEditor::editKey('LOG_LEVEL', 'error'); }
644 644
             }
645
-        } elseif($type === "register") {
646
-            if($request->toggle != ''){$register = "true";}else{$register = "false";}
645
+        } elseif ($type === "register") {
646
+            if ($request->toggle != '') {$register = "true"; } else {$register = "false"; }
647 647
             Page::first()->update(['register' => $register]);
648
-        } elseif($type === "smtp") {
649
-            if($request->toggle != ''){$value = "built-in";}else{$value = "smtp";}
650
-            if(EnvEditor::keyExists('MAIL_MAILER')){EnvEditor::editKey('MAIL_MAILER', $value);}
651
-
652
-            if(EnvEditor::keyExists('MAIL_HOST')){EnvEditor::editKey('MAIL_HOST', $request->MAIL_HOST);}
653
-            if(EnvEditor::keyExists('MAIL_PORT')){EnvEditor::editKey('MAIL_PORT', $request->MAIL_PORT);}
654
-            if(EnvEditor::keyExists('MAIL_USERNAME')){EnvEditor::editKey('MAIL_USERNAME', '"' . $request->MAIL_USERNAME . '"');}
655
-            if(EnvEditor::keyExists('MAIL_PASSWORD')){EnvEditor::editKey('MAIL_PASSWORD', '"' . $request->MAIL_PASSWORD . '"');}
656
-            if(EnvEditor::keyExists('MAIL_ENCRYPTION')){EnvEditor::editKey('MAIL_ENCRYPTION', $request->MAIL_ENCRYPTION);}
657
-            if(EnvEditor::keyExists('MAIL_FROM_ADDRESS')){EnvEditor::editKey('MAIL_FROM_ADDRESS', $request->MAIL_FROM_ADDRESS);}
658
-        } elseif($type === "homeurl") {
659
-            if($request->value == 'default'){$value = "";}else{$value = '"' . $request->value . '"';}
660
-            if(EnvEditor::keyExists($entry)){EnvEditor::editKey($entry, $value);}
661
-        } elseif($type === "maintenance") {
662
-            if($request->toggle != ''){$value = "true";}else{$value = "false";}
663
-            if(file_exists(base_path("storage/MAINTENANCE"))){unlink(base_path("storage/MAINTENANCE"));}
664
-            if(EnvEditor::keyExists($entry)){EnvEditor::editKey($entry, $value);}
648
+        } elseif ($type === "smtp") {
649
+            if ($request->toggle != '') {$value = "built-in"; } else {$value = "smtp"; }
650
+            if (EnvEditor::keyExists('MAIL_MAILER')) {EnvEditor::editKey('MAIL_MAILER', $value); }
651
+
652
+            if (EnvEditor::keyExists('MAIL_HOST')) {EnvEditor::editKey('MAIL_HOST', $request->MAIL_HOST); }
653
+            if (EnvEditor::keyExists('MAIL_PORT')) {EnvEditor::editKey('MAIL_PORT', $request->MAIL_PORT); }
654
+            if (EnvEditor::keyExists('MAIL_USERNAME')) {EnvEditor::editKey('MAIL_USERNAME', '"' . $request->MAIL_USERNAME . '"'); }
655
+            if (EnvEditor::keyExists('MAIL_PASSWORD')) {EnvEditor::editKey('MAIL_PASSWORD', '"' . $request->MAIL_PASSWORD . '"'); }
656
+            if (EnvEditor::keyExists('MAIL_ENCRYPTION')) {EnvEditor::editKey('MAIL_ENCRYPTION', $request->MAIL_ENCRYPTION); }
657
+            if (EnvEditor::keyExists('MAIL_FROM_ADDRESS')) {EnvEditor::editKey('MAIL_FROM_ADDRESS', $request->MAIL_FROM_ADDRESS); }
658
+        } elseif ($type === "homeurl") {
659
+            if ($request->value == 'default') {$value = ""; } else {$value = '"' . $request->value . '"'; }
660
+            if (EnvEditor::keyExists($entry)) {EnvEditor::editKey($entry, $value); }
661
+        } elseif ($type === "maintenance") {
662
+            if ($request->toggle != '') {$value = "true"; } else {$value = "false"; }
663
+            if (file_exists(base_path("storage/MAINTENANCE"))) {unlink(base_path("storage/MAINTENANCE")); }
664
+            if (EnvEditor::keyExists($entry)) {EnvEditor::editKey($entry, $value); }
665 665
         } else {
666
-            if(EnvEditor::keyExists($entry)){EnvEditor::editKey($entry, $value);}
666
+            if (EnvEditor::keyExists($entry)) {EnvEditor::editKey($entry, $value); }
667 667
         }
668 668
 
669 669
 
@@ -687,7 +687,7 @@  discard block
 block discarded – undo
687 687
 
688 688
         $user = User::find($userID);
689 689
 
690
-        if($user->remember_token == $token && $request->session()->get('display_auth_nav') === $user->remember_token){
690
+        if ($user->remember_token == $token && $request->session()->get('display_auth_nav') === $user->remember_token) {
691 691
             $user->auth_as = null;
692 692
             $user->remember_token = null;
693 693
             $user->save();
Please login to merge, or discard this patch.
Braces   +9 added lines, -7 removed lines patch added patch discarded remove patch
@@ -527,7 +527,9 @@  discard block
 block discarded – undo
527 527
                     $text = file_get_contents(base_path('themes') . '/' . $entry . '/readme.md');
528 528
                     $pattern = '/Theme Version:.*/';
529 529
                     preg_match($pattern, $text, $matches, PREG_OFFSET_CAPTURE);
530
-                    if (!count($matches)) continue;
530
+                    if (!count($matches)) {
531
+                        continue;
532
+                    }
531 533
                     $verNr = substr($matches[0][0], 15);
532 534
 
533 535
                 }
@@ -625,10 +627,10 @@  discard block
 block discarded – undo
625 627
         $value = $request->value;
626 628
 
627 629
         if($type === "toggle"){
628
-            if($request->toggle != ''){$value = "true";}else{$value = "false";}
630
+            if($request->toggle != ''){$value = "true";} else{$value = "false";}
629 631
             if(EnvEditor::keyExists($entry)){EnvEditor::editKey($entry, $value);}
630 632
         } elseif($type === "toggle2") {
631
-            if($request->toggle != ''){$value = "verified";}else{$value = "auth";}
633
+            if($request->toggle != ''){$value = "verified";} else{$value = "auth";}
632 634
             if(EnvEditor::keyExists($entry)){EnvEditor::editKey($entry, $value);}
633 635
         } elseif($type === "text") {
634 636
             if(EnvEditor::keyExists($entry)){EnvEditor::editKey($entry, '"' . $value . '"');}
@@ -643,10 +645,10 @@  discard block
 block discarded – undo
643 645
                 if(EnvEditor::keyExists('LOG_LEVEL')){EnvEditor::editKey('LOG_LEVEL', 'error');}
644 646
             }
645 647
         } elseif($type === "register") {
646
-            if($request->toggle != ''){$register = "true";}else{$register = "false";}
648
+            if($request->toggle != ''){$register = "true";} else{$register = "false";}
647 649
             Page::first()->update(['register' => $register]);
648 650
         } elseif($type === "smtp") {
649
-            if($request->toggle != ''){$value = "built-in";}else{$value = "smtp";}
651
+            if($request->toggle != ''){$value = "built-in";} else{$value = "smtp";}
650 652
             if(EnvEditor::keyExists('MAIL_MAILER')){EnvEditor::editKey('MAIL_MAILER', $value);}
651 653
 
652 654
             if(EnvEditor::keyExists('MAIL_HOST')){EnvEditor::editKey('MAIL_HOST', $request->MAIL_HOST);}
@@ -656,10 +658,10 @@  discard block
 block discarded – undo
656 658
             if(EnvEditor::keyExists('MAIL_ENCRYPTION')){EnvEditor::editKey('MAIL_ENCRYPTION', $request->MAIL_ENCRYPTION);}
657 659
             if(EnvEditor::keyExists('MAIL_FROM_ADDRESS')){EnvEditor::editKey('MAIL_FROM_ADDRESS', $request->MAIL_FROM_ADDRESS);}
658 660
         } elseif($type === "homeurl") {
659
-            if($request->value == 'default'){$value = "";}else{$value = '"' . $request->value . '"';}
661
+            if($request->value == 'default'){$value = "";} else{$value = '"' . $request->value . '"';}
660 662
             if(EnvEditor::keyExists($entry)){EnvEditor::editKey($entry, $value);}
661 663
         } elseif($type === "maintenance") {
662
-            if($request->toggle != ''){$value = "true";}else{$value = "false";}
664
+            if($request->toggle != ''){$value = "true";} else{$value = "false";}
663 665
             if(file_exists(base_path("storage/MAINTENANCE"))){unlink(base_path("storage/MAINTENANCE"));}
664 666
             if(EnvEditor::keyExists($entry)){EnvEditor::editKey($entry, $value);}
665 667
         } else {
Please login to merge, or discard this patch.