Conditions | 6 |
Paths | 4 |
Total Lines | 14 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 6 |
Changes | 3 | ||
Bugs | 1 | Features | 1 |
1 | <?php |
||
10 | public static function getHttpScheme(): string |
||
11 | { |
||
12 | if (isset($_SERVER['HTTP_SCHEME'])) { |
||
13 | return $_SERVER['HTTP_SCHEME']; |
||
14 | } |
||
15 | 18 | ||
16 | if (isset($_SERVER['HTTPS']) && \strtolower($_SERVER['HTTPS']) !== 'off') { |
||
17 | 18 | return 'https'; |
|
18 | 2 | } |
|
19 | |||
20 | if (isset($_SERVER['SERVER_PORT']) && 443 === (int)$_SERVER['SERVER_PORT']) { |
||
21 | 16 | return 'https'; |
|
22 | 1 | } |
|
23 | return 'http'; |
||
24 | } |
||
37 |