src/Phug/Formatter.php
public function getFormatInstance($format = null)
    {
        $format = $format ?: $this->format;

        if (!($format instanceof FormatInterface)) {
            if (!isset($this->formats[$format])) {
                $event = new NewFormatEvent($this, new $format($this));
                $this->trigger($event);
                $this->formats[$format] = $event->getFormat();
            }

            $format = $this->formats[$format];
        }

        return $format;
    }
public function getFormatInstance($format = null)
    {
        $format = $format ?: $this->format;

        if (!($format instanceof FormatInterface)) {
            if (!isset($this->formats[$format])) {
                $event = new NewFormatEvent($this, new $format($this));
                $this->trigger($event);
                $this->formats[$format] = $event->getFormat();
            }

            $format = $this->formats[$format];
        }

        return $format;
    }
public function getFormatInstance ( $ format = null ) { $ format = $ format ? : $ this -> format ; if ( ! ( $ format instanceof FormatInterface ) ) { if ( ! isset ( $ this -> formats [ $ format ] ) ) { $ event = new NewFormatEvent ( $ this , new $ format ( $ this ) ) ; $ this -> trigger ( $ event ) ; $ this -> formats [ $ format ] = $ event -> getFormat ( ) ; } $ format = $ this -> formats [ $ format ] ; } return $ format ; }
Return current format as instance of FormatInterface.

@param FormatInterface|string optional format, if missing current format is used

@return FormatInterface
Return current format as instance of FormatInterface .