Passed
Push — main ( 58dab3...bdbaee )
by Julian
11:46
created
app/Functions/functions.php 1 patch
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.
app/Models/Link.php 1 patch
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.
app/Http/Controllers/LinkTypeViewController.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
         // dynamiclly create params for predefined website to fill a select list with available buttons
64 64
         if (!empty($linkType) && $linkType->typename === 'predefined') {
65 65
             $buttons = Button::select('name')->orderBy('name', 'asc')->get();
66
-           $pdParams[] = ['tag' => 'select', 'name' => 'button', 'id'=> 'button'];
66
+            $pdParams[] = ['tag' => 'select', 'name' => 'button', 'id'=> 'button'];
67 67
             foreach ($buttons as $btn) {
68 68
                 $pdParams[0]['value'][] = [
69 69
                     'tag'=>'option',
@@ -133,10 +133,10 @@  discard block
 block discarded – undo
133 133
                 $typeParams = json_decode($link['type_params']);
134 134
 
135 135
 
136
- //echo "<pre>";
136
+    //echo "<pre>";
137 137
 //  print_r($typeParams);
138
-                  //print_r($params[$idx]);
139
-                 //echo "</pre>";
138
+                    //print_r($params[$idx]);
139
+                    //echo "</pre>";
140 140
 
141 141
                 if ($typeParams && property_exists($typeParams, $params[$idx]['name'])) {
142 142
                     if (key_exists('value', $params[$idx]) && is_array($params[$idx]['value'])) {
Please login to merge, or discard this patch.
app/Http/Kernel.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@
 block discarded – undo
65 65
         'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
66 66
         'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
67 67
         'link-id' => \App\Http\Middleware\LinkId::class,
68
-	    'admin' => \App\Http\Middleware\admin::class,
68
+        'admin' => \App\Http\Middleware\admin::class,
69 69
         'blocked' => \App\Http\Middleware\CheckBlockedUser::class,
70 70
         'max.users' => \App\Http\Middleware\MaxUsers::class,
71 71
         'impersonate' => \App\Http\Middleware\Impersonate::class,
Please login to merge, or discard this patch.
app/Http/Middleware/Impersonate.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 {
13 13
     public function handle($request, Closure $next)
14 14
     {
15
-      if(Schema::hasColumn('users', 'auth_as')) {
15
+        if(Schema::hasColumn('users', 'auth_as')) {
16 16
         $adminUser = User::where('role', 'admin')->where(function ($query) {
17 17
             $query->where('auth_as', '!=', null)
18 18
                 ->where('auth_as', '!=', '');
@@ -159,9 +159,9 @@  discard block
 block discarded – undo
159 159
             return $next($request);
160 160
         }
161 161
 
162
-      } else {
162
+        } else {
163 163
         return $next($request);
164
-      }
164
+        }
165 165
 
166 166
     }
167 167
 }
Please login to merge, or discard this patch.
app/Http/Middleware/admin.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -18,10 +18,10 @@
 block discarded – undo
18 18
     public function handle(Request $request, Closure $next)
19 19
     {
20 20
 
21
-      //check is admin
22
-      if (Auth::user() && Auth::user()->role == 'admin') {
21
+        //check is admin
22
+        if (Auth::user() && Auth::user()->role == 'admin') {
23 23
             return $next($request);
24
-      }   
24
+        }   
25 25
 
26 26
             return redirect(url('dashboard'));
27 27
     }
Please login to merge, or discard this patch.
app/View/Components/PageItemDisplay.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@
 block discarded – undo
18 18
     public function __construct($link)
19 19
     {
20 20
         // $this->title = $title;
21
-         $this->link = $link;
21
+            $this->link = $link;
22 22
     }
23 23
 
24 24
     /**
Please login to merge, or discard this patch.