| Conditions | 3 |
| Paths | 2 |
| Total Lines | 11 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 44 | protected function getIPAddress( \Psr\Http\Message\ServerRequestInterface $request ) |
||
| 45 | { |
||
| 46 | $server = $request->getServerParams(); |
||
| 47 | $flags = FILTER_FLAG_IPV4 | FILTER_FLAG_IPV6; |
||
| 48 | |||
| 49 | if( isset( $server['REMOTE_ADDR'] ) |
||
| 50 | && ( $ip = filter_var( $server['REMOTE_ADDR'], FILTER_VALIDATE_IP, $flags ) ) !== false |
||
| 51 | ) { |
||
| 52 | return $ip; |
||
| 53 | } |
||
| 54 | } |
||
| 55 | } |
||
| 56 |