@@ -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 | } |
@@ -274,7 +274,7 @@ discard block |
||
274 | 274 | |
275 | 275 | function ShadowsocksSingbox($ShadowsocksUrl) { |
276 | 276 | $decoded_shadowsocks = ParseShadowsocks($ShadowsocksUrl); |
277 | - if (is_null($decoded_shadowsocks['name']) || $decoded_shadowsocks['name'] === ""){ |
|
277 | + if (is_null($decoded_shadowsocks['name']) || $decoded_shadowsocks['name'] === "") { |
|
278 | 278 | return null; |
279 | 279 | } |
280 | 280 | if ($decoded_shadowsocks['encryption_method'] === "chacha20-poly1305") { |
@@ -333,7 +333,7 @@ discard block |
||
333 | 333 | return $configResult; |
334 | 334 | } |
335 | 335 | |
336 | -function GenerateConfig($input, $output, $theType){ |
|
336 | +function GenerateConfig($input, $output, $theType) { |
|
337 | 337 | $outbound = []; |
338 | 338 | $v2ray_subscription = str_replace(" ", "%20", $input); |
339 | 339 | |
@@ -341,7 +341,7 @@ discard block |
||
341 | 341 | foreach ($configArray as $config) { |
342 | 342 | $configType = detect_type($config); |
343 | 343 | $config = str_replace("%20", " ", $config); |
344 | - switch($configType) { |
|
344 | + switch ($configType) { |
|
345 | 345 | case "vmess": |
346 | 346 | $configSingbox = VmessSingbox($config); |
347 | 347 | break; |
@@ -358,9 +358,9 @@ discard block |
||
358 | 358 | $configSingbox = ShadowsocksSingbox($config); |
359 | 359 | break; |
360 | 360 | } |
361 | - if (!is_null($configSingbox)){ |
|
361 | + if (!is_null($configSingbox)) { |
|
362 | 362 | $configName = $configSingbox['tag']; |
363 | - if (stripos($configName, "RELAY |