@@ -14,14 +14,14 @@ discard block |
||
| 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 | } |
@@ -271,7 +271,7 @@ discard block |
||
| 271 | 271 | |
| 272 | 272 | function ShadowsocksSingbox($ShadowsocksUrl) { |
| 273 | 273 | $decoded_shadowsocks = ParseShadowsocks($ShadowsocksUrl); |
| 274 | - if (is_null($decoded_shadowsocks['name']) || $decoded_shadowsocks['name'] === ""){ |
|
| 274 | + if (is_null($decoded_shadowsocks['name']) || $decoded_shadowsocks['name'] === "") { |
|
| 275 | 275 | return null; |
| 276 | 276 | } |
| 277 | 277 | if ($decoded_shadowsocks['encryption_method'] === "chacha20-poly1305") { |
@@ -371,7 +371,7 @@ discard block |
||
| 371 | 371 | return $configResult; |
| 372 | 372 | } |
| 373 | 373 | |
| 374 | -function GenerateConfig($input, $output, $theType){ |
|
| 374 | +function GenerateConfig($input, $output, $theType) { |
|
| 375 | 375 | $outbound = []; |
| 376 | 376 | $v2ray_subscription = str_replace(" ", "%20", $input); |
| 377 | 377 | |
@@ -379,7 +379,7 @@ discard block |
||
| 379 | 379 | foreach ($configArray as $config) { |
| 380 | 380 | $configType = detect_type($config); |
| 381 | 381 | $config = str_replace("%20", " ", $config); |
| 382 | - switch($configType) { |
|
| 382 | + switch ($configType) { |
|
| 383 | 383 | case "vmess": |
| 384 | 384 | $configSingbox = VmessSingbox($config); |
| 385 | 385 | break; |
@@ -399,9 +399,9 @@ discard block |
||
| 399 | 399 | $configSingbox = ShadowsocksSingbox($config); |
| 400 | 400 | break; |
| 401 | 401 | } |
| 402 | - if (!is_null($configSingbox)){ |
|
| 402 | + if (!is_null($configSingbox)) { |
|
| 403 | 403 | $configName = $configSingbox['tag']; |
| 404 | - if (stripos($configName, "RELAY |
|