Passed
Push — main ( e70ca5...050d5e )
by Julian
04:08
created
app/Http/Livewire/UserTable.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
             Column::make(__('messages.Page'), "littlelink_name")
40 40
                 ->sortable()
41 41
                 ->searchable()
42
-                ->format(function ($value, $row, Column $column) {
42
+                ->format(function($value, $row, Column $column) {
43 43
                     if (!$row->littlelink_name == NULL) {
44 44
                         return "<a href='" . url('') . "/@" . htmlspecialchars($row->littlelink_name) . "' target='_blank' class='text-info'><i class='bi bi-box-arrow-up-right'></i>&nbsp; " . htmlspecialchars($row->littlelink_name) . " </a>";
45 45
                     } else {
@@ -51,23 +51,23 @@  discard block
 block discarded – undo
51 51
                 ->sortable()
52 52
                 ->searchable(),
53 53
             Column::make(__('messages.Links'), "id")
54
-                ->format(function ($value, $row) {
54
+                ->format(function($value, $row) {
55 55
                     $linkCount = Link::where('user_id', $row->id)->count();
56 56
                     return $linkCount;
57 57
                 }),
58 58
             Column::make(__('messages.Clicks'), "id")
59
-                ->format(function ($value, $row) {
59
+                ->format(function($value, $row) {
60 60
                     $clicksSum = Link::where('user_id', $row->id)->sum('click_number');
61 61
                     return $clicksSum;
62 62
                 }),
63 63
             Column::make(__('messages.E-Mail'), "email_verified_at")
64 64
                 ->sortable()
65
-                ->format(function ($value, $row, Column $column) {
65
+                ->format(function($value, $row, Column $column) {
66 66
                     if (env('REGISTER_AUTH') !== 'auth') {
67 67
                         if ($row->role == 'admin' && $row->email_verified_at != '') {
68 68
                             return '<div class="text-center">-</div>';
69 69
                         } else {
70
-                            if($row->email_verified_at == ''){
70
+                            if ($row->email_verified_at == '') {
71 71
                                 $verifyLinkBool = 'true';
72 72
                             } else {
73 73
                                 $verifyLinkBool = 'false';
@@ -77,9 +77,9 @@  discard block
 block discarded – undo
77 77
                                 'id' => $row->id
78 78
                             ]);
79 79
                             if ($row->email_verified_at == '') {
80
-                                return '<div class="text-center"><a style="cursor:pointer" data-id="'.$verifyLink.'" class="user-email text-danger"><span class="badge bg-danger">' . __('messages.Pending') . '</span></a></div>';
80
+                                return '<div class="text-center"><a style="cursor:pointer" data-id="' . $verifyLink . '" class="user-email text-danger"><span class="badge bg-danger">' . __('messages.Pending') . '</span></a></div>';
81 81
                             } else {
82
-                                return '<div class="text-center"><a style="cursor:pointer" data-id="'.$verifyLink.'" class="user-email text-danger"><span class="badge bg-success">' . __('messages.Verified') . '</span></a></div>';
82
+                                return '<div class="text-center"><a style="cursor:pointer" data-id="' . $verifyLink . '" class="user-email text-danger"><span class="badge bg-success">' . __('messages.Verified') . '</span></a></div>';
83 83
                             }
84 84
                         }
85 85
                     } else {
@@ -89,15 +89,15 @@  discard block
 block discarded – undo
89 89
                 })->html(),
90 90
             Column::make(__('messages.Status'), "block")
91 91
                 ->sortable()
92
-                ->format(function ($value, $row, Column $column) {
92
+                ->format(function($value, $row, Column $column) {
93 93
                     if ($row->role === 'admin' && $row->id === 1) {
94 94
                         return '<div class="text-center">-</div>';
95 95
                     } else {
96 96
                         $route = route('blockUser', ['block' => $row->block, 'id' => $row->id]);
97 97
                         if ($row->block === 'yes') {
98
-                            $badge = '<div class="text-center"><a style="cursor:pointer" data-id="'.$route.'" class="user-block text-danger"><span class="badge bg-danger">'.__('messages.Pending').'</span></a></div>';
98
+                            $badge = '<div class="text-center"><a style="cursor:pointer" data-id="' . $route . '" class="user-block text-danger"><span class="badge bg-danger">' . __('messages.Pending') . '</span></a></div>';
99 99
                         } elseif ($row->block === 'no') {
100
-                            $badge = '<div class="text-center"><a style="cursor:pointer" data-id="'.$route.'" class="user-block text-danger"><span class="badge bg-success">'.__('messages.Approved').'</span></a></div>';
100
+                            $badge = '<div class="text-center"><a style="cursor:pointer" data-id="' . $route . '" class="user-block text-danger"><span class="badge bg-success">' . __('messages.Approved') . '</span></a></div>';
101 101
                         }
102 102
                         return "<a href=\"$route\">$badge</a>";
103 103
                     }
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
                 ->html(),
106 106
             Column::make(__('messages.Created at'), "created_at")
107 107
                 ->sortable()
108
-                ->format(function ($value) {
108
+                ->format(function($value) {
109 109
                     if ($value) {
110 110
                         return $value->format('d/m/y');
111 111
                     } else {
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
                 }),
115 115
             Column::make(__('messages.Last seen'), "updated_at")
116 116
                 ->sortable()
117
-                ->format(function ($value) {
117
+                ->format(function($value) {
118 118
                     $now = now();
119 119
                     $diff = $now->diff($value);
120 120
             
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
                     }
130 130
                 }),
131 131
                 Column::make(__('messages.Action'), "id")
132
-                ->format(function ($value, $row, Column $column) {
132
+                ->format(function($value, $row, Column $column) {
133 133
                     return view('components.table-components.action', ['user' => $row]);
134 134
                 }),
135 135
         ];
Please login to merge, or discard this patch.
app/Providers/AppServiceProvider.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
37 37
 
38 38
             return $query->count() === 0;
39 39
         });
40
-        Validator::extend('exturl', function ($attribute, $value, $parameters, $validator) {
40
+        Validator::extend('exturl', function($attribute, $value, $parameters, $validator) {
41 41
             $allowed_schemes = ['http', 'https', 'mailto', 'tel'];
42 42
             return in_array(parse_url($value, PHP_URL_SCHEME), $allowed_schemes, true);
43 43
         });
Please login to merge, or discard this patch.
app/Http/Middleware/DisableCookies.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -11,13 +11,13 @@
 block discarded – undo
11 11
 
12 12
     public function handle(Request $request, Closure $next)
13 13
     {
14
-        $cookiesAlreadySet = $request->hasCookie(strtolower(config('app.name')).'_session') || $request->hasCookie('XSRF-TOKEN');
14
+        $cookiesAlreadySet = $request->hasCookie(strtolower(config('app.name')) . '_session') || $request->hasCookie('XSRF-TOKEN');
15 15
 
16 16
         if ($cookiesAlreadySet) {
17 17
             return $next($request);
18 18
         }
19 19
 
20
-        Cookie::queue(Cookie::forget(str_replace(' ', '_', strtolower(config('app.name')).'_session')));
20
+        Cookie::queue(Cookie::forget(str_replace(' ', '_', strtolower(config('app.name')) . '_session')));
21 21
         Cookie::queue(Cookie::forget('XSRF-TOKEN'));
22 22
         config(['session.driver' => 'array']);
23 23
 
Please login to merge, or discard this patch.
app/Models/LinkType.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@
 block discarded – undo
65 65
             'text',
66 66
         ];
67 67
     
68
-        $sorted = $linkTypes->sortBy(function ($item) use ($custom_order) {
68
+        $sorted = $linkTypes->sortBy(function($item) use ($custom_order) {
69 69
             $index = array_search($item->typename, $custom_order);
70 70
             return $index !== false ? $index : count($custom_order);
71 71
         });
Please login to merge, or discard this patch.
app/Http/Controllers/UserController.php 2 patches
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
     //Show littlelink page. example => http://127.0.0.1:8000/+admin
85 85
     public function littlelink(request $request)
86 86
     {
87
-        if(isset($request->useif)){
87
+        if (isset($request->useif)) {
88 88
             $littlelink_name = User::select('littlelink_name')->where('id', $request->littlelink)->value('littlelink_name');
89 89
             $id = $request->littlelink;
90 90
         } else {
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
             return abort(404);
161 161
         }
162 162
 
163
-        return redirect(url('@'.$user));
163
+        return redirect(url('@' . $user));
164 164
     }
165 165
 
166 166
     //Show add/update form
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
         $LinkURL = $request->link;
196 196
 
197 197
         // Step 3: Load Link Type Logic
198
-        if($request->typename == 'predefined') {
198
+        if ($request->typename == 'predefined') {
199 199
             $button = Button::where('name', $request->button)->first();
200 200
             $linkData = [
201 201
                 'link' => $LinkURL,
@@ -244,7 +244,7 @@  discard block
 block discarded – undo
244 244
 
245 245
         if ($OrigLink) {
246 246
             $currentValues = $OrigLink->getAttributes();
247
-            $nonNullFilteredLinkData = array_filter($filteredLinkData, function($value) {return !is_null($value);});
247
+            $nonNullFilteredLinkData = array_filter($filteredLinkData, function($value) {return !is_null($value); });
248 248
             $updatedValues = array_merge($currentValues, $nonNullFilteredLinkData);
249 249
             $OrigLink->update($updatedValues);
250 250
             $message = "Link updated";
@@ -306,7 +306,7 @@  discard block
 block discarded – undo
306 306
 
307 307
         if (substr($linkId, -1) == '+') {
308 308
             $linkWithoutPlus = str_replace('+', '', $linkId);
309
-            return redirect(url('info/'.$linkWithoutPlus));
309
+            return redirect(url('info/' . $linkWithoutPlus));
310 310
         }
311 311
     
312 312
         $link = Link::find($linkId);
@@ -397,11 +397,11 @@  discard block
 block discarded – undo
397 397
 
398 398
         $directory = base_path("assets/favicon/icons");
399 399
         $files = scandir($directory);
400
-        foreach($files as $file) {
401
-        if (strpos($file, $linkId.".") !== false) {
402
-        $pathinfo = pathinfo($file, PATHINFO_EXTENSION);}}
400
+        foreach ($files as $file) {
401
+        if (strpos($file, $linkId . ".") !== false) {
402
+        $pathinfo = pathinfo($file, PATHINFO_EXTENSION); }}
403 403
         if (isset($pathinfo)) {
404
-        try{File::delete(base_path("assets/favicon/icons")."/".$linkId.".".$pathinfo);} catch (exception $e) {}
404
+        try {File::delete(base_path("assets/favicon/icons") . "/" . $linkId . "." . $pathinfo); } catch (exception $e) {}
405 405
         }
406 406
 
407 407
         return redirect('/studio/links');
@@ -414,11 +414,11 @@  discard block
 block discarded – undo
414 414
 
415 415
         $directory = base_path("assets/favicon/icons");
416 416
         $files = scandir($directory);
417
-        foreach($files as $file) {
418
-        if (strpos($file, $linkId.".") !== false) {
419
-        $pathinfo = pathinfo($file, PATHINFO_EXTENSION);}}
417
+        foreach ($files as $file) {
418
+        if (strpos($file, $linkId . ".") !== false) {
419
+        $pathinfo = pathinfo($file, PATHINFO_EXTENSION); }}
420 420
         if (isset($pathinfo)) {
421
-        try{File::delete(base_path("assets/favicon/icons")."/".$linkId.".".$pathinfo);} catch (exception $e) {}
421
+        try {File::delete(base_path("assets/favicon/icons") . "/" . $linkId . "." . $pathinfo); } catch (exception $e) {}
422 422
         }
423 423
 
424 424
         return redirect('/studio/links');
@@ -542,7 +542,7 @@  discard block
 block discarded – undo
542 542
                 'sometimes',
543 543
                 'max:255',
544 544
                 'string',
545
-                'isunique:users,id,'.$userId,
545
+                'isunique:users,id,' . $userId,
546 546
             ],
547 547
             'name' => 'sometimes|max:255|string',
548 548
             'image' => 'sometimes|image|mimes:jpeg,jpg,png,webp|max:2048', // Max file size: 2MB
@@ -567,7 +567,7 @@  discard block
 block discarded – undo
567 567
         $sharebtn = $request->sharebtn;
568 568
         $tablinks = $request->tablinks;
569 569
 
570
-        if(env('HOME_URL') !== '' && $pageName != $littlelink_name && $littlelink_name == env('HOME_URL')){
570
+        if (env('HOME_URL') !== '' && $pageName != $littlelink_name && $littlelink_name == env('HOME_URL')) {
571 571
             EnvEditor::editKey('HOME_URL', $pageName);
572 572
         }
573 573
     
@@ -801,7 +801,7 @@  discard block
 block discarded – undo
801 801
         // echo Auth::id();
802 802
         $id = $request->id;
803 803
 
804
-    if($id == Auth::id() and $id != "1") {
804
+    if ($id == Auth::id() and $id != "1") {
805 805
 
806 806
         Link::where('user_id', $id)->delete();
807 807
 
@@ -848,7 +848,7 @@  discard block
 block discarded – undo
848 848
         $fileName = "links-$domain-$date.json";
849 849
         $headers = [
850 850
             'Content-Type' => 'application/json',
851
-            'Content-Disposition' => 'attachment; filename="'.$fileName.'"',
851
+            'Content-Disposition' => 'attachment; filename="' . $fileName . '"',
852 852
         ];
853 853
         return response()->json($userData, 200, $headers);
854 854
 
@@ -870,7 +870,7 @@  discard block
 block discarded – undo
870 870
         $userData = $user->toArray();
871 871
         $userData['links'] = $links->toArray();
872 872
 
873
-        if (file_exists(base_path(findAvatar($userId)))){
873
+        if (file_exists(base_path(findAvatar($userId)))) {
874 874
             $imagePath = base_path(findAvatar($userId));
875 875
             $imageData = base64_encode(file_get_contents($imagePath));
876 876
             $userData['image_data'] = $imageData;
@@ -884,7 +884,7 @@  discard block
 block discarded – undo
884 884
         $fileName = "user_data-$domain-$date.json";
885 885
         $headers = [
886 886
             'Content-Type' => 'application/json',
887
-            'Content-Disposition' => 'attachment; filename="'.$fileName.'"',
887
+            'Content-Disposition' => 'attachment; filename="' . $fileName . '"',
888 888
         ];
889 889
         return response()->json($userData, 200, $headers);
890 890
     
Please login to merge, or discard this patch.
Braces   +13 added lines, -9 removed lines patch added patch discarded remove patch
@@ -221,7 +221,9 @@  discard block
 block discarded – undo
221 221
         // Step 5: User and Button Information
222 222
         $userId = Auth::user()->id;
223 223
         $button = Button::where('name', $request->button)->first();
224
-        if ($button && empty($LinkTitle)) $LinkTitle = $button->alt;
224
+        if ($button && empty($LinkTitle)) {
225
+            $LinkTitle = $button->alt;
226
+        }
225 227
 
226 228
         // Step 6: Prepare Link Data
227 229
         // (Handled by the included file)
@@ -484,14 +486,16 @@  discard block
 block discarded – undo
484 486
             'button' => 'required',
485 487
         ]);
486 488
 
487
-        if (stringStartsWith($request->link, 'http://') == 'true' or stringStartsWith($request->link, 'https://') == 'true' or stringStartsWith($request->link, 'mailto:') == 'true')
488
-            $link1 = $request->link;
489
-        else
490
-            $link1 = 'https://' . $request->link;
491
-        if (stringEndsWith($request->link, '/') == 'true')
492
-            $link = rtrim($link1, "/ ");
493
-        else
494
-        $link = $link1;
489
+        if (stringStartsWith($request->link, 'http://') == 'true' or stringStartsWith($request->link, 'https://') == 'true' or stringStartsWith($request->link, 'mailto:') == 'true') {
490
+                    $link1 = $request->link;
491
+        } else {
492
+                    $link1 = 'https://' . $request->link;
493
+        }
494
+        if (stringEndsWith($request->link, '/') == 'true') {
495
+                    $link = rtrim($link1, "/ ");
496
+        } else {
497
+                $link = $link1;
498
+        }
495 499
         $title = $request->title;
496 500
         $order = $request->order;
497 501
         $button = $request->button;
Please login to merge, or discard this patch.
app/Functions/functions.php 2 patches
Indentation   +36 added lines, -36 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();
@@ -153,43 +153,43 @@  discard block
 block discarded – undo
153 153
 }
154 154
 
155 155
 if(!function_exists('setBlockAssetContext')) {
156
-  function setBlockAssetContext($type = null) {
157
-      static $currentType = null;
158
-      if ($type !== null) {
159
-          $currentType = $type;
160
-      }
161
-      return $currentType;
162
-  }
156
+    function setBlockAssetContext($type = null) {
157
+        static $currentType = null;
158
+        if ($type !== null) {
159
+            $currentType = $type;
160
+        }
161
+        return $currentType;
162
+    }
163 163
 }
164 164
 
165 165
 // Get custom block assets
166 166
 if(!function_exists('block_asset')) {
167
-  function block_asset($file) {
168
-      $type = setBlockAssetContext(); // Retrieve the current type context
169
-      return url("block-asset/$type?asset=$file");
170
-  }
167
+    function block_asset($file) {
168
+        $type = setBlockAssetContext(); // Retrieve the current type context
169
+        return url("block-asset/$type?asset=$file");
170
+    }
171 171
 }
172 172
 
173 173
 if(!function_exists('get_block_file_contents')) {
174
-  function get_block_file_contents($file) {
175
-      $type = setBlockAssetContext(); // Retrieve the current type context
176
-      return file_get_contents(base_path("blocks/$type/$file"));
177
-  }
174
+    function get_block_file_contents($file) {
175
+        $type = setBlockAssetContext(); // Retrieve the current type context
176
+        return file_get_contents(base_path("blocks/$type/$file"));
177
+    }
178 178
 }
179 179
 
180 180
 function block_text_translation_check($text) {
181
-  if (empty($text)) {
181
+    if (empty($text)) {
182 182
     return false;
183
-  }
184
-  $translate = __("messages.$text");
185
-  return $translate === "messages.$text" ? true : false;
183
+    }
184
+    $translate = __("messages.$text");
185
+    return $translate === "messages.$text" ? true : false;
186 186
 }
187 187
 
188 188
 function block_text($text) {
189
-  $translate = __("messages.$text");
190
-  return $translate === "messages.$text" ? $text : $translate;
189
+    $translate = __("messages.$text");
190
+    return $translate === "messages.$text" ? $text : $translate;
191 191
 }
192 192
 
193 193
 function bt($text) {
194
-  return block_text($text);
194
+    return block_text($text);
195 195
 }
196 196
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 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
 }
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
     return $str;
153 153
 }
154 154
 
155
-if(!function_exists('setBlockAssetContext')) {
155
+if (!function_exists('setBlockAssetContext')) {
156 156
   function setBlockAssetContext($type = null) {
157 157
       static $currentType = null;
158 158
       if ($type !== null) {
@@ -163,14 +163,14 @@  discard block
 block discarded – undo
163 163
 }
164 164
 
165 165
 // Get custom block assets
166
-if(!function_exists('block_asset')) {
166
+if (!function_exists('block_asset')) {
167 167
   function block_asset($file) {
168 168
       $type = setBlockAssetContext(); // Retrieve the current type context
169 169
       return url("block-asset/$type?asset=$file");
170 170
   }
171 171
 }
172 172
 
173
-if(!function_exists('get_block_file_contents')) {
173
+if (!function_exists('get_block_file_contents')) {
174 174
   function get_block_file_contents($file) {
175 175
       $type = setBlockAssetContext(); // Retrieve the current type context
176 176
       return file_get_contents(base_path("blocks/$type/$file"));
Please login to merge, or discard this patch.