| 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 |
||
| 10 | 15 | static public function getHttpScheme(): string |
|
| 11 | { |
||
| 12 | 15 | $scheme = 'http'; |
|
| 13 | 15 | if (isset($_SERVER['HTTP_SCHEME'])) { |
|
| 14 | 1 | return $_SERVER['HTTP_SCHEME']; |
|
| 15 | } |
||
| 16 | |||
| 17 | 14 | if (isset($_SERVER['HTTPS']) && \strtolower($_SERVER['HTTPS']) != 'off') { |
|
| 18 | 1 | return 'https'; |
|
| 19 | } |
||
| 20 | |||
| 21 | 13 | if (isset($_SERVER['SERVER_PORT']) && 443 == $_SERVER['SERVER_PORT']) { |
|
| 22 | 1 | return 'https'; |
|
| 23 | } |
||
| 24 | 12 | return $scheme; |
|
| 25 | } |
||
| 26 | } |