PygmentsElephant/Pygmentize.php
public function formatFile($filename, $lexer = null, array $options = array())
    {
        if (!$this->fs->exists($filename)) {
            throw new \InvalidArgumentException(sprintf('the file %s doesn\'t exists', $filename));
        }
        $this->subject = $filename;
        $this->lexer = null === $lexer ? $this->binary->guessLexer($filename) : $lexer;
        $this->format = 'html';

        return $this->binary->execute($this, array_merge($this->options, $options));
    }
public function formatFile($filename, $lexer = null, array $options = array())
    {
        if (!$this->fs->exists($filename)) {
            throw new \InvalidArgumentException(sprintf('the file %s doesn\'t exists', $filename));
        }
        $this->subject = $filename;
        $this->lexer = null === $lexer ? $this->binary->guessLexer($filename) : $lexer;
        $this->format = 'html';

        return $this->binary->execute($this, array_merge($this->options, $options));
    }
public function formatFile ( $ filename , $ lexer = null , array $ options = array ( ) ) { if ( ! $ this -> fs -> exists ( $ filename ) ) { throw new \ InvalidArgumentException ( sprintf ( 'the file %s doesn\'t exists' , $ filename ) ) ; } $ this -> subject = $ filename ; $ this -> lexer = null === $ lexer ? $ this -> binary -> guessLexer ( $ filename ) : $ lexer ; $ this -> format = 'html' ; return $ this -> binary -> execute ( $ this , array_merge ( $ this -> options , $ options ) ) ; }
format a file by its name

@param string $filename file name
@param string $lexer lexer
@param array $options

@return string
format a file by its name