src/Endpoint.php
protected function setIp($ip)
    {
        if (filter_var($ip, FILTER_VALIDATE_IP) === false) {
            throw new \InvalidArgumentException('$ip must be correct');
        }

        $this->ip = $ip;
    }
protected function setIp($ip)
    {
        if (filter_var($ip, FILTER_VALIDATE_IP) === false) {
            throw new \InvalidArgumentException('$ip must be correct');
        }

        $this->ip = $ip;
    }
protected function setIp ( $ ip ) { if ( filter_var ( $ ip , FILTER_VALIDATE_IP ) === false ) { throw new \ InvalidArgumentException ( '$ip must be correct' ) ; } $ this -> ip = $ ip ; }
Valid and set ip

@param $ip string

@throws \InvalidArgumentException
Valid and set ip