protected function getClientIp()
    {
        if ($this->requestStack->getCurrentRequest() === null) {
            throw new \RuntimeException(sprintf('%s can not be called outside of request cycle', __METHOD__));
        }

        return $this->requestStack->getCurrentRequest()->getClientIp() ?: '127.0.0.1';
    }
protected function getClientIp()
    {
        if ($this->requestStack->getCurrentRequest() === null) {
            throw new \RuntimeException(sprintf('%s can not be called outside of request cycle', __METHOD__));
        }

        return $this->requestStack->getCurrentRequest()->getClientIp() ?: '127.0.0.1';
    }
protected function getClientIp ( ) { if ( $ this -> requestStack -> getCurrentRequest ( ) === null ) { throw new \ RuntimeException ( sprintf ( '%s can not be called outside of request cycle' , __METHOD__ ) ) ; } return $ this -> requestStack -> getCurrentRequest ( ) -> getClientIp ( ) ? : '127.0.0.1' ; }
Return the user's IP address.

@return string
Return the user s IP address .