Conditions | 3 |
Paths | 3 |
Total Lines | 13 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
9 | public static function getRemoteAddress(): string |
||
10 | { |
||
11 | if (PhpHelper::isCli()) { |
||
12 | return \gethostbyname(\php_uname('n')); |
||
13 | } |
||
14 | |||
15 | // phpcs:ignore SlevomatCodingStandard.Variables.DisallowSuperGlobalVariable.DisallowedSuperGlobalVariable |
||
16 | if (\array_key_exists('REMOTE_ADDR', $_SERVER)) { |
||
17 | // phpcs:ignore SlevomatCodingStandard.Variables.DisallowSuperGlobalVariable.DisallowedSuperGlobalVariable |
||
18 | return \WebServCo\Framework\Utils\Request::sanitizeString($_SERVER['REMOTE_ADDR']); |
||
19 | } |
||
20 | |||
21 | return ''; |
||
22 | } |
||
24 |