Passed
Push — main ( e785aa...5b1eae )
by YeBeKhe
02:16
created
modules/singbox.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -14,14 +14,14 @@  discard block
 block discarded – undo
14 14
     return $length % 2 == 0;
15 15
 }
16 16
 
17
-function process_jsons($input, $locationNames){
17
+function process_jsons($input, $locationNames) {
18 18
     $input[0]['outbounds'] = array_merge($input[0]['outbounds'], array_filter($locationNames));
19 19
     return $input;
20 20
 }
21 21
 
22
-function extract_names($input){
23
-    foreach($input as $config){
24
-        if ($config['tag'] !== ""){
22
+function extract_names($input) {
23
+    foreach ($input as $config) {
24
+        if ($config['tag'] !== "") {
25 25
              $locationNames[] = $config['tag'];
26 26
         }
27 27
     }
@@ -269,7 +269,7 @@  discard block
 block discarded – undo
269 269
 
270 270
 function ShadowsocksSingbox($ShadowsocksUrl) {
271 271
     $decoded_shadowsocks = ParseShadowsocks($ShadowsocksUrl);
272
-    if (is_null($decoded_shadowsocks['name']) || $decoded_shadowsocks['name'] === ""){
272
+    if (is_null($decoded_shadowsocks['name']) || $decoded_shadowsocks['name'] === "") {
273 273
         return null;
274 274
     }
275 275
     if ($decoded_shadowsocks['encryption_method'] === "chacha20-poly1305") {
@@ -369,7 +369,7 @@  discard block
 block discarded – undo
369 369
     return $configResult;
370 370
 }
371 371
 
372
-function GenerateConfig($input, $output, $theType){
372
+function GenerateConfig($input, $output, $theType) {
373 373
     $outbound = [];
374 374
     $v2ray_subscription = str_replace(" ", "%20", $input);
375 375
 
@@ -377,7 +377,7 @@  discard block
 block discarded – undo
377 377
     foreach ($configArray as $config) {
378 378
         $configType = detect_type($config);
379 379
         $config = str_replace("%20", " ", $config);
380
-        switch($configType) {
380
+        switch ($configType) {
381 381
             case "vmess":
382 382
                 $configSingbox = VmessSingbox($config);
383 383
                 break;
@@ -397,9 +397,9 @@  discard block
 block discarded – undo
397 397
                 $configSingbox = ShadowsocksSingbox($config);
398 398
                 break;
399 399
         }
400
-        if (!is_null($configSingbox)){
400
+        if (!is_null($configSingbox)) {
401 401
             $configName = $configSingbox['tag'];
402
-            if (stripos($configName, "RELAY
Please login to merge, or discard this patch.