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