original_string: public function validateIP($ipAddress = null)
      {
          if ($ipAddress === null) {
              $parsed = parse_url($this->uri);
              $ipAddress = isset($parsed['host']) ? $parsed['host'] : null;
          }
          return (
              filter_var($ipAddress, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) ||
              filter_var(trim($ipAddress, '[]'), FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)
          );
      }
code: public function validateIP($ipAddress = null)
      {
          if ($ipAddress === null) {
              $parsed = parse_url($this->uri);
              $ipAddress = isset($parsed['host']) ? $parsed['host'] : null;
          }
          return (
              filter_var($ipAddress, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) ||
              filter_var(trim($ipAddress, '[]'), FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)
          );
      }
code_tokens: public function validateIP ( $ ipAddress = null ) { if ( $ ipAddress === null ) { $ parsed = parse_url ( $ this -> uri ) ; $ ipAddress = isset ( $ parsed [ 'host' ] ) ? $ parsed [ 'host' ] : null ; } return ( filter_var ( $ ipAddress , FILTER_VALIDATE_IP , FILTER_FLAG_IPV4 ) || filter_var ( trim ( $ ipAddress , '[]' ) , FILTER_VALIDATE_IP , FILTER_FLAG_IPV6 ) ) ; }
docstring: Validate IPv4 or IPv6
  
  @param  string|null $ipAddress
  @return bool
docstring_tokens: Validate IPv4 or IPv6