src/Highlighter.php
public function highlight(string $source, bool $withLineNumber = false): string
    {
        $tokenLines = $this->getHighlightedLines($source);
        $lines      = $this->colorLines($tokenLines);

        if ($withLineNumber) {
            return $this->lineNumbers($lines);
        }

        return \implode(\PHP_EOL, $lines);
    }
public function highlight(string $source, bool $withLineNumber = false): string
    {
        $tokenLines = $this->getHighlightedLines($source);
        $lines      = $this->colorLines($tokenLines);

        if ($withLineNumber) {
            return $this->lineNumbers($lines);
        }

        return \implode(\PHP_EOL, $lines);
    }
public function highlight ( string $ source , bool $ withLineNumber = false ) : string { $ tokenLines = $ this -> getHighlightedLines ( $ source ) ; $ lines = $ this -> colorLines ( $ tokenLines ) ; if ( $ withLineNumber ) { return $ this -> lineNumbers ( $ lines ) ; } return \ implode ( \ PHP_EOL , $ lines ) ; }
highlight a full php file content
@param string $source
@param bool   $withLineNumber with line number
@return string
highlight a full php file content