public function format($format = true)
    {
        if (!is_bool($format)) {
            throw new InvalidArgumentException(sprintf('%s expects parameter 1 to be boolean, %s given', __METHOD__, gettype($format)));
        }

        $this->document->formatOutput = $format;

        return $this;
    }
public function format($format = true)
    {
        if (!is_bool($format)) {
            throw new InvalidArgumentException(sprintf('%s expects parameter 1 to be boolean, %s given', __METHOD__, gettype($format)));
        }

        $this->document->formatOutput = $format;

        return $this;
    }
public function format ( $ format = true ) { if ( ! is_bool ( $ format ) ) { throw new InvalidArgumentException ( sprintf ( '%s expects parameter 1 to be boolean, %s given' , __METHOD__ , gettype ( $ format ) ) ) ; } $ this -> document -> formatOutput = $ format ; return $ this ; }
Nicely formats output with indentation and extra space.

@param bool $format Formats output if true

@return \DiDom\Document
Nicely formats output with indentation and extra space .