public function setParser($parser) {
        switch ($parser) {
            case self::PARSER_XML:
            case self::PARSER_XMLDTD:
            case self::PARSER_HTML:
            case self::PARSER_HTML5:
            case self::PARSER_HTML4:
            case self::PARSER_HTML4TR:
                $this->parser = $parser;
                return $this;
            default:
                throw new UnknownParserException('Unknown parser "' . $parser . '"');
        }
    }
public function setParser($parser) {
        switch ($parser) {
            case self::PARSER_XML:
            case self::PARSER_XMLDTD:
            case self::PARSER_HTML:
            case self::PARSER_HTML5:
            case self::PARSER_HTML4:
            case self::PARSER_HTML4TR:
                $this->parser = $parser;
                return $this;
            default:
                throw new UnknownParserException('Unknown parser "' . $parser . '"');
        }
    }
public function setParser ( $ parser ) { switch ( $ parser ) { case self :: PARSER_XML : case self :: PARSER_XMLDTD : case self :: PARSER_HTML : case self :: PARSER_HTML5 : case self :: PARSER_HTML4 : case self :: PARSER_HTML4TR : $ this -> parser = $ parser ; return $ this ; default : throw new UnknownParserException ( 'Unknown parser "' . $ parser . '"' ) ; } }
Set parser to use for the given markup

@param string $parser Parser name (use Validator::PARSER_*)
@return Validator Returns current instance
@throws UnknownParserException If parser specified is not known
Set parser to use for the given markup