protected function validateString(string $string)
    {
        if (strlen($string) > self::MAX_LENGTH || !filter_var($string, FILTER_VALIDATE_IP)) {
            throw InvalidArgumentException::format(
                    'Cannot construct class %s: argument must be a valid ip address, \'%s\' given',
                    get_class($this), $string
            );
        }
    }
protected function validateString(string $string)
    {
        if (strlen($string) > self::MAX_LENGTH || !filter_var($string, FILTER_VALIDATE_IP)) {
            throw InvalidArgumentException::format(
                    'Cannot construct class %s: argument must be a valid ip address, \'%s\' given',
                    get_class($this), $string
            );
        }
    }
protected function validateString ( string $ string ) { if ( strlen ( $ string ) > self :: MAX_LENGTH || ! filter_var ( $ string , FILTER_VALIDATE_IP ) ) { throw InvalidArgumentException :: format ( 'Cannot construct class %s: argument must be a valid ip address, \'%s\' given' , get_class ( $ this ) , $ string ) ; } }
Validates the string is in the required format.

@param string $string

@return void
@throws InvalidArgumentException
Validates the string is in the required format .