Passed
Push — main ( 1b7a26...4b0048 )
by YeBeKhe
02:25
created
modules/singbox.php 2 patches
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
     }
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
 
277 277
 function ShadowsocksSingbox($ShadowsocksUrl) {
278 278
     $decoded_shadowsocks = ParseShadowsocks($ShadowsocksUrl);
279
-    if (is_null($decoded_shadowsocks['name']) || $decoded_shadowsocks['name'] === ""){
279
+    if (is_null($decoded_shadowsocks['name']) || $decoded_shadowsocks['name'] === "") {
280 280
         return null;
281 281
     }
282 282
     if ($decoded_shadowsocks['encryption_method'] === "chacha20-poly1305") {
@@ -376,7 +376,7 @@  discard block
 block discarded – undo
376 376
     return $configResult;
377 377
 }
378 378
 
379
-function GenerateConfig($input, $output, $theType){
379
+function GenerateConfig($input, $output, $theType) {
380 380
     $outbound = [];
381 381
     $v2ray_subscription = str_replace(" ", "%20", $input);
382 382
 
@@ -384,7 +384,7 @@  discard block
 block discarded – undo
384 384
     foreach ($configArray as $config) {
385 385
         $configType = detect_type($config);
386 386
         $config = str_replace("%20", " ", $config);
387
-        switch($configType) {
387
+        switch ($configType) {
388 388
             case "vmess":
389 389
                 $configSingbox = VmessSingbox($config);
390 390
                 break;
@@ -404,9 +404,9 @@  discard block
 block discarded – undo
404 404
                 $configSingbox = ShadowsocksSingbox($config);
405 405
                 break;
406 406
         }
407
-        if (!is_null($configSingbox)){
407
+        if (!is_null($configSingbox)) {
408 408
             $configName = $configSingbox['tag'];
409
-            if (stripos($configName, "RELAY
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -101,7 +101,9 @@
 block discarded – undo
101 101
             "max_early_data" => $pathProcess['max_early_data'],
102 102
             "early_data_header_name" => "Sec-WebSocket-Protocol",
103 103
         ];
104
-        if ($configResult["transport"]["headers"]["Host"] === "") return null;
104
+        if ($configResult["transport"]["headers"]["Host"] === "") {
105
+            return null;
106
+        }
105 107
     } elseif ($decode_vmess["net"] === "grpc") {
106 108
         $configResult["transport"] = [
107 109
             "type" => $decode_vmess["net"],
Please login to merge, or discard this patch.