public function wrap($parser, $nodes, $charset = null) {
        switch ($parser) {
            case Validator::PARSER_XML:
            case Validator::PARSER_XMLDTD:
                return $this->wrapInXmlDocument($nodes, $charset);
            case Validator::PARSER_HTML:
            case Validator::PARSER_HTML5:
                return $this->wrapInHtml5Document($nodes, $charset);
            case Validator::PARSER_HTML4:
            case Validator::PARSER_HTML4TR:
                return $this->wrapInHtml4Document($nodes, $charset, $parser);
            default:
                throw new UnknownParserException('Unknown parser "' . $parser . '"');
        }
    }
public function wrap($parser, $nodes, $charset = null) {
        switch ($parser) {
            case Validator::PARSER_XML:
            case Validator::PARSER_XMLDTD:
                return $this->wrapInXmlDocument($nodes, $charset);
            case Validator::PARSER_HTML:
            case Validator::PARSER_HTML5:
                return $this->wrapInHtml5Document($nodes, $charset);
            case Validator::PARSER_HTML4:
            case Validator::PARSER_HTML4TR:
                return $this->wrapInHtml4Document($nodes, $charset, $parser);
            default:
                throw new UnknownParserException('Unknown parser "' . $parser . '"');
        }
    }
public function wrap ( $ parser , $ nodes , $ charset = null ) { switch ( $ parser ) { case Validator :: PARSER_XML : case Validator :: PARSER_XMLDTD : return $ this -> wrapInXmlDocument ( $ nodes , $ charset ) ; case Validator :: PARSER_HTML : case Validator :: PARSER_HTML5 : return $ this -> wrapInHtml5Document ( $ nodes , $ charset ) ; case Validator :: PARSER_HTML4 : case Validator :: PARSER_HTML4TR : return $ this -> wrapInHtml4Document ( $ nodes , $ charset , $ parser ) ; default : throw new UnknownParserException ( 'Unknown parser "' . $ parser . '"' ) ; } }
Attempts to wrap a document in a surrounding document

@param  string $parser  Parser name (HtmlValidator\Validator::PARSER_*)
@param  string $nodes   Nodes to wrap
@param  string $charset Charset to use
@throws UnknownParserException If the given parser is not known
@return string
Attempts to wrap a document in a surrounding document