@@ -1,17 +1,17 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Highlighter |
|
| 4 | - * |
|
| 5 | - * Copyright (C) 2015, Some right reserved. |
|
| 6 | - * |
|
| 7 | - * @author Kacper "Kadet" Donat <[email protected]> |
|
| 8 | - * |
|
| 9 | - * Contact with author: |
|
| 10 | - * Xmpp: [email protected] |
|
| 11 | - * E-mail: [email protected] |
|
| 12 | - * |
|
| 13 | - * From Kadet with love. |
|
| 14 | - */ |
|
| 3 | + * Highlighter |
|
| 4 | + * |
|
| 5 | + * Copyright (C) 2015, Some right reserved. |
|
| 6 | + * |
|
| 7 | + * @author Kacper "Kadet" Donat <[email protected]> |
|
| 8 | + * |
|
| 9 | + * Contact with author: |
|
| 10 | + * Xmpp: [email protected] |
|
| 11 | + * E-mail: [email protected] |
|
| 12 | + * |
|
| 13 | + * From Kadet with love. |
|
| 14 | + */ |
|
| 15 | 15 | |
| 16 | 16 | namespace Kadet\Highlighter\Utils; |
| 17 | 17 | |
@@ -1,17 +1,17 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Highlighter |
|
| 4 | - *1 |
|
| 5 | - * Copyright (C) 2015, Some right reserved. |
|
| 6 | - * |
|
| 7 | - * @author Kacper "Kadet" Donat <[email protected]> |
|
| 8 | - * |
|
| 9 | - * Contact with author: |
|
| 10 | - * Xmpp: [email protected] |
|
| 11 | - * E-mail: [email protected] |
|
| 12 | - * |
|
| 13 | - * From Kadet with love. |
|
| 14 | - */ |
|
| 3 | + * Highlighter |
|
| 4 | + *1 |
|
| 5 | + * Copyright (C) 2015, Some right reserved. |
|
| 6 | + * |
|
| 7 | + * @author Kacper "Kadet" Donat <[email protected]> |
|
| 8 | + * |
|
| 9 | + * Contact with author: |
|
| 10 | + * Xmpp: [email protected] |
|
| 11 | + * E-mail: [email protected] |
|
| 12 | + * |
|
| 13 | + * From Kadet with love. |
|
| 14 | + */ |
|
| 15 | 15 | |
| 16 | 16 | namespace Kadet\Highlighter\Utils; |
| 17 | 17 | |
@@ -20,7 +20,7 @@ |
||
| 20 | 20 | { |
| 21 | 21 | public function match($source) |
| 22 | 22 | { |
| 23 | - return array_filter(parent::match($source), function (Token $token) { |
|
| 23 | + return array_filter(parent::match($source), function(Token $token) { |
|
| 24 | 24 | if ($token->isEnd()) { |
| 25 | 25 | $token->setStart(null); |
| 26 | 26 | |
@@ -1,17 +1,17 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Highlighter |
|
| 4 | - * |
|
| 5 | - * Copyright (C) 2015, Some right reserved. |
|
| 6 | - * |
|
| 7 | - * @author Kacper "Kadet" Donat <[email protected]> |
|
| 8 | - * |
|
| 9 | - * Contact with author: |
|
| 10 | - * Xmpp: [email protected] |
|
| 11 | - * E-mail: [email protected] |
|
| 12 | - * |
|
| 13 | - * From Kadet with love. |
|
| 14 | - */ |
|
| 3 | + * Highlighter |
|
| 4 | + * |
|
| 5 | + * Copyright (C) 2015, Some right reserved. |
|
| 6 | + * |
|
| 7 | + * @author Kacper "Kadet" Donat <[email protected]> |
|
| 8 | + * |
|
| 9 | + * Contact with author: |
|
| 10 | + * Xmpp: [email protected] |
|
| 11 | + * E-mail: [email protected] |
|
| 12 | + * |
|
| 13 | + * From Kadet with love. |
|
| 14 | + */ |
|
| 15 | 15 | |
| 16 | 16 | namespace Kadet\Highlighter\Utils; |
| 17 | 17 | |
@@ -1,17 +1,17 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Highlighter |
|
| 4 | - * |
|
| 5 | - * Copyright (C) 2015, Some right reserved. |
|
| 6 | - * |
|
| 7 | - * @author Kacper "Kadet" Donat <[email protected]> |
|
| 8 | - * |
|
| 9 | - * Contact with author: |
|
| 10 | - * Xmpp: [email protected] |
|
| 11 | - * E-mail: [email protected] |
|
| 12 | - * |
|
| 13 | - * From Kadet with love. |
|
| 14 | - */ |
|
| 3 | + * Highlighter |
|
| 4 | + * |
|
| 5 | + * Copyright (C) 2015, Some right reserved. |
|
| 6 | + * |
|
| 7 | + * @author Kacper "Kadet" Donat <[email protected]> |
|
| 8 | + * |
|
| 9 | + * Contact with author: |
|
| 10 | + * Xmpp: [email protected] |
|
| 11 | + * E-mail: [email protected] |
|
| 12 | + * |
|
| 13 | + * From Kadet with love. |
|
| 14 | + */ |
|
| 15 | 15 | |
| 16 | 16 | namespace Kadet\Highlighter\Utils; |
| 17 | 17 | |
@@ -1,17 +1,17 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Highlighter |
|
| 4 | - * |
|
| 5 | - * Copyright (C) 2016, Some right reserved. |
|
| 6 | - * |
|
| 7 | - * @author Kacper "Kadet" Donat <[email protected]> |
|
| 8 | - * |
|
| 9 | - * Contact with author: |
|
| 10 | - * Xmpp: [email protected] |
|
| 11 | - * E-mail: [email protected] |
|
| 12 | - * |
|
| 13 | - * From Kadet with love. |
|
| 14 | - */ |
|
| 3 | + * Highlighter |
|
| 4 | + * |
|
| 5 | + * Copyright (C) 2016, Some right reserved. |
|
| 6 | + * |
|
| 7 | + * @author Kacper "Kadet" Donat <[email protected]> |
|
| 8 | + * |
|
| 9 | + * Contact with author: |
|
| 10 | + * Xmpp: [email protected] |
|
| 11 | + * E-mail: [email protected] |
|
| 12 | + * |
|
| 13 | + * From Kadet with love. |
|
| 14 | + */ |
|
| 15 | 15 | |
| 16 | 16 | namespace Kadet\Highlighter\Language; |
| 17 | 17 | |
@@ -1,17 +1,17 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Highlighter |
|
| 4 | - *1 |
|
| 5 | - * Copyright (C) 2015, Some right reserved. |
|
| 6 | - * |
|
| 7 | - * @author Kacper "Kadet" Donat <[email protected]> |
|
| 8 | - * |
|
| 9 | - * Contact with author: |
|
| 10 | - * Xmpp: [email protected] |
|
| 11 | - * E-mail: [email protected] |
|
| 12 | - * |
|
| 13 | - * From Kadet with love. |
|
| 14 | - */ |
|
| 3 | + * Highlighter |
|
| 4 | + *1 |
|
| 5 | + * Copyright (C) 2015, Some right reserved. |
|
| 6 | + * |
|
| 7 | + * @author Kacper "Kadet" Donat <[email protected]> |
|
| 8 | + * |
|
| 9 | + * Contact with author: |
|
| 10 | + * Xmpp: [email protected] |
|
| 11 | + * E-mail: [email protected] |
|
| 12 | + * |
|
| 13 | + * From Kadet with love. |
|
| 14 | + */ |
|
| 15 | 15 | |
| 16 | 16 | namespace Kadet\Highlighter\Utils; |
| 17 | 17 | |
@@ -1,19 +1,19 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Highlighter |
|
| 4 | - * |
|
| 5 | - * Copyright (C) 2016, Some right reserved. |
|
| 6 | - * |
|
| 7 | - * @author Kacper "Kadet" Donat <[email protected]> |
|
| 8 | - * |
|
| 9 | - * Contact with author: |
|
| 10 | - * Xmpp: [email protected] |
|
| 11 | - * E-mail: [email protected] |
|
| 12 | - * |
|
| 13 | - * From Kadet with love. |
|
| 14 | - * |
|
| 15 | - * Just Simple CLI App implementation, subject to change. |
|
| 16 | - */ |
|
| 3 | + * Highlighter |
|
| 4 | + * |
|
| 5 | + * Copyright (C) 2016, Some right reserved. |
|
| 6 | + * |
|
| 7 | + * @author Kacper "Kadet" Donat <[email protected]> |
|
| 8 | + * |
|
| 9 | + * Contact with author: |
|
| 10 | + * Xmpp: [email protected] |
|
| 11 | + * E-mail: [email protected] |
|
| 12 | + * |
|
| 13 | + * From Kadet with love. |
|
| 14 | + * |
|
| 15 | + * Just Simple CLI App implementation, subject to change. |
|
| 16 | + */ |
|
| 17 | 17 | |
| 18 | 18 | use Kadet\Highlighter\Utils\Console; |
| 19 | 19 | |
@@ -17,9 +17,9 @@ discard block |
||
| 17 | 17 | |
| 18 | 18 | use Kadet\Highlighter\Utils\Console; |
| 19 | 19 | |
| 20 | -require __DIR__.'/../vendor/autoload.php'; |
|
| 20 | +require __DIR__ . '/../vendor/autoload.php'; |
|
| 21 | 21 | |
| 22 | -$title = Console::styled(['color' => 'yellow'], 'KeyLighter ').'v'.\Kadet\Highlighter\KeyLighter::VERSION.' by Kadet'; |
|
| 22 | +$title = Console::styled(['color' => 'yellow'], 'KeyLighter ') . 'v' . \Kadet\Highlighter\KeyLighter::VERSION . ' by Kadet'; |
|
| 23 | 23 | $formatters = [ |
| 24 | 24 | 'html' => new \Kadet\Highlighter\Formatter\HtmlFormatter(), |
| 25 | 25 | 'cli' => new \Kadet\Highlighter\Formatter\CliFormatter(), |
@@ -27,17 +27,17 @@ discard block |
||
| 27 | 27 | |
| 28 | 28 | function printTable($table, $spacing = 4) { |
| 29 | 29 | $max = []; |
| 30 | - foreach(array_keys(reset($table)) as $key) { |
|
| 30 | + foreach (array_keys(reset($table)) as $key) { |
|
| 31 | 31 | $max[$key] = max(array_map(function($option) use ($key) { return strlen($option[$key]); }, $table)) + $spacing; |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | - if(isset($key)) { |
|
| 34 | + if (isset($key)) { |
|
| 35 | 35 | $max[$key] = 0; // Reset last |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | foreach ($table as $option) { |
| 39 | 39 | echo "\t"; |
| 40 | - foreach($option as $key => $cell) { |
|
| 40 | + foreach ($option as $key => $cell) { |
|
| 41 | 41 | echo str_pad($cell, $max[$key], ' ', STR_PAD_RIGHT); |
| 42 | 42 | } |
| 43 | 43 | echo PHP_EOL; |
@@ -53,12 +53,12 @@ discard block |
||
| 53 | 53 | function getOption($options, $value = true, $default = null) { |
| 54 | 54 | global $argv; |
| 55 | 55 | |
| 56 | - foreach($options as $option) { |
|
| 57 | - if($pos = array_search($option, $argv)) { |
|
| 56 | + foreach ($options as $option) { |
|
| 57 | + if ($pos = array_search($option, $argv)) { |
|
| 58 | 58 | $return = !$value || !isset($argv[$pos + 1]) ? $default : $argv[$pos + 1]; |
| 59 | 59 | |
| 60 | - if($value && isset($argv[$pos + 1])) { |
|
| 61 | - unset($argv[$pos+1]); |
|
| 60 | + if ($value && isset($argv[$pos + 1])) { |
|
| 61 | + unset($argv[$pos + 1]); |
|
| 62 | 62 | } |
| 63 | 63 | unset($argv[$pos]); |
| 64 | 64 | |
@@ -70,29 +70,29 @@ discard block |
||
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | function benchmark($description, callable $callable) { |
| 73 | - echo Console::styled(['color' => 'yellow'], $description.'... '); |
|
| 73 | + echo Console::styled(['color' => 'yellow'], $description . '... '); |
|
| 74 | 74 | $start = microtime(true); |
| 75 | 75 | $return = $callable(); |
| 76 | 76 | $done = microtime(true) - $start; |
| 77 | - echo Console::styled(['color' => 'green'], 'Done! ').number_format($done, 3).'s'.PHP_EOL; |
|
| 77 | + echo Console::styled(['color' => 'green'], 'Done! ') . number_format($done, 3) . 's' . PHP_EOL; |
|
| 78 | 78 | |
| 79 | 79 | return $return; |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | -if($argc == 1) { |
|
| 82 | +if ($argc == 1) { |
|
| 83 | 83 | echo $title, PHP_EOL, PHP_EOL; |
| 84 | 84 | |
| 85 | - echo Console::styled(['color' => 'green'], 'Usage: '), 'php '.$argv[0].' [options] file', PHP_EOL; |
|
| 85 | + echo Console::styled(['color' => 'green'], 'Usage: '), 'php ' . $argv[0] . ' [options] file', PHP_EOL; |
|
| 86 | 86 | |
| 87 | 87 | echo Console::styled(['color' => 'green'], 'Options: '), PHP_EOL; |
| 88 | 88 | printTable([ |
| 89 | - ['-l, --language', 'language', 'Source Language to highlight, default: xml > php'], |
|
| 90 | - ['-f, --format', 'format', 'Formatter used to highlight source, for example: html, default: cli'], |
|
| 91 | - ['-h, --help', null, 'This screen'], |
|
| 92 | - ['-v, --verbose', 'level', 'Verbose mode'], |
|
| 93 | - ['-lf, --formatters', null, 'List available formatters'], |
|
| 94 | - ['-ll, --languages', null, 'List available languages'], |
|
| 95 | - ['-s, --silent', null, 'No output, '], |
|
| 89 | + ['-l, --language', 'language', 'Source Language to highlight, default: xml > php'], |
|
| 90 | + ['-f, --format', 'format', 'Formatter used to highlight source, for example: html, default: cli'], |
|
| 91 | + ['-h, --help', null, 'This screen'], |
|
| 92 | + ['-v, --verbose', 'level', 'Verbose mode'], |
|
| 93 | + ['-lf, --formatters', null, 'List available formatters'], |
|
| 94 | + ['-ll, --languages', null, 'List available languages'], |
|
| 95 | + ['-s, --silent', null, 'No output, '], |
|
| 96 | 96 | |
| 97 | 97 | ]); |
| 98 | 98 | exit(0); |
@@ -100,19 +100,19 @@ discard block |
||
| 100 | 100 | |
| 101 | 101 | unset($argv[0]); |
| 102 | 102 | |
| 103 | -if(getOption(['-ll', '--languages'], false, true)) { |
|
| 103 | +if (getOption(['-ll', '--languages'], false, true)) { |
|
| 104 | 104 | $languages = \Kadet\Highlighter\KeyLighter::registeredLanguages(); |
| 105 | 105 | |
| 106 | 106 | $result = []; |
| 107 | - foreach($languages as $alias => $class) { |
|
| 108 | - if(!isset($result[$class])) { |
|
| 107 | + foreach ($languages as $alias => $class) { |
|
| 108 | + if (!isset($result[$class])) { |
|
| 109 | 109 | $result[$class] = ['aliases' => [], 'class' => $class]; |
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | $result[$class]['aliases'][] = $alias; |
| 113 | 113 | } |
| 114 | 114 | |
| 115 | - echo Console::styled(['color' => 'green'], 'Available languages: ').PHP_EOL; |
|
| 115 | + echo Console::styled(['color' => 'green'], 'Available languages: ') . PHP_EOL; |
|
| 116 | 116 | |
| 117 | 117 | printTable(array_map(function($language) { |
| 118 | 118 | return [ |
@@ -125,8 +125,8 @@ discard block |
||
| 125 | 125 | exit(0); |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | -if(getOption(['-lf', '--formatters'], false, true)) { |
|
| 129 | - echo Console::styled(['color' => 'green'], 'Available formatters: ').PHP_EOL; |
|
| 128 | +if (getOption(['-lf', '--formatters'], false, true)) { |
|
| 129 | + echo Console::styled(['color' => 'green'], 'Available formatters: ') . PHP_EOL; |
|
| 130 | 130 | printTable(array_map(function($name, $formatter) { |
| 131 | 131 | return [ |
| 132 | 132 | Console::styled(['color' => 'yellow'], $name), |
@@ -138,43 +138,43 @@ discard block |
||
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | $language = \Kadet\Highlighter\KeyLighter::getLanguage(getOption(['-l', '--language']) ?: 'php'); |
| 141 | -$verbose = getOption(['-v', '--verbose'], true, 1) ?: 0; |
|
| 141 | +$verbose = getOption(['-v', '--verbose'], true, 1) ?: 0; |
|
| 142 | 142 | $formatter = getFormatter(getOption(['-f', '--format'])) ?: \Kadet\Highlighter\KeyLighter::getDefaultFormatter(); |
| 143 | 143 | $silent = getOption(['-s', '--silent'], false, true); |
| 144 | 144 | |
| 145 | 145 | $file = reset($argv); |
| 146 | 146 | |
| 147 | -if($verbose > 0) { |
|
| 148 | - echo $title.PHP_EOL; |
|
| 147 | +if ($verbose > 0) { |
|
| 148 | + echo $title . PHP_EOL; |
|
| 149 | 149 | echo PHP_EOL; |
| 150 | - echo Console::styled(['color' => 'green'], 'Language: ').get_class($language).PHP_EOL; |
|
| 150 | + echo Console::styled(['color' => 'green'], 'Language: ') . get_class($language) . PHP_EOL; |
|
| 151 | 151 | |
| 152 | 152 | $embedded = $language->getEmbedded(); |
| 153 | - if(!empty($embedded)) { |
|
| 154 | - echo Console::styled(['color' => 'green'], ' With: ').implode(', ', array_map('get_class', $embedded)).PHP_EOL; |
|
| 153 | + if (!empty($embedded)) { |
|
| 154 | + echo Console::styled(['color' => 'green'], ' With: ') . implode(', ', array_map('get_class', $embedded)) . PHP_EOL; |
|
| 155 | 155 | |
| 156 | 156 | } |
| 157 | 157 | |
| 158 | - echo Console::styled(['color' => 'green'], 'Formatter: ').get_class($formatter).PHP_EOL; |
|
| 159 | - echo Console::styled(['color' => 'green'], 'File: ').$file.PHP_EOL; |
|
| 158 | + echo Console::styled(['color' => 'green'], 'Formatter: ') . get_class($formatter) . PHP_EOL; |
|
| 159 | + echo Console::styled(['color' => 'green'], 'File: ') . $file . PHP_EOL; |
|
| 160 | 160 | echo PHP_EOL; |
| 161 | 161 | } |
| 162 | 162 | |
| 163 | -if(!file_exists($file)) { |
|
| 164 | - echo Console::styled(['color' => 'red'], 'File not exists.').PHP_EOL; |
|
| 163 | +if (!file_exists($file)) { |
|
| 164 | + echo Console::styled(['color' => 'red'], 'File not exists.') . PHP_EOL; |
|
| 165 | 165 | die(1); |
| 166 | 166 | } |
| 167 | 167 | |
| 168 | 168 | $source = file_get_contents($file); |
| 169 | -if($verbose > 1) { |
|
| 169 | +if ($verbose > 1) { |
|
| 170 | 170 | $tokens = benchmark('Tokenization', function() use($language, $source) { return $language->tokenize($source); }); |
| 171 | 171 | $tokens = benchmark('Parsing', function() use($language, $tokens) { return $language->parse($tokens); }); |
| 172 | 172 | $formatted = benchmark('Formatting', function() use($formatter, $tokens, $source) { |
| 173 | 173 | return $formatter->format($source, new ArrayIterator($tokens)); |
| 174 | 174 | }); |
| 175 | 175 | |
| 176 | - if(function_exists('xdebug_peak_memory_usage')) { |
|
| 177 | - echo Console::styled(['color' => 'green'], 'Max memory usage: ').number_format(xdebug_peak_memory_usage()/1024/1024, 4).'MBytes'.PHP_EOL; |
|
| 176 | + if (function_exists('xdebug_peak_memory_usage')) { |
|
| 177 | + echo Console::styled(['color' => 'green'], 'Max memory usage: ') . number_format(xdebug_peak_memory_usage() / 1024 / 1024, 4) . 'MBytes' . PHP_EOL; |
|
| 178 | 178 | } |
| 179 | 179 | |
| 180 | 180 | echo PHP_EOL; |
@@ -182,6 +182,6 @@ discard block |
||
| 182 | 182 | $formatted = \Kadet\Highlighter\KeyLighter::highlight($source, $language, $formatter); |
| 183 | 183 | } |
| 184 | 184 | |
| 185 | -if(!$silent) { |
|
| 186 | - echo $formatted.PHP_EOL; |
|
| 185 | +if (!$silent) { |
|
| 186 | + echo $formatted . PHP_EOL; |
|
| 187 | 187 | } |
| 188 | 188 | \ No newline at end of file |
@@ -1,17 +1,17 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Highlighter |
|
| 4 | - * |
|
| 5 | - * Copyright (C) 2015, Some right reserved. |
|
| 6 | - * |
|
| 7 | - * @author Kacper "Kadet" Donat <[email protected]> |
|
| 8 | - * |
|
| 9 | - * Contact with author: |
|
| 10 | - * Xmpp: [email protected] |
|
| 11 | - * E-mail: [email protected] |
|
| 12 | - * |
|
| 13 | - * From Kadet with love. |
|
| 14 | - */ |
|
| 3 | + * Highlighter |
|
| 4 | + * |
|
| 5 | + * Copyright (C) 2015, Some right reserved. |
|
| 6 | + * |
|
| 7 | + * @author Kacper "Kadet" Donat <[email protected]> |
|
| 8 | + * |
|
| 9 | + * Contact with author: |
|
| 10 | + * Xmpp: [email protected] |
|
| 11 | + * E-mail: [email protected] |
|
| 12 | + * |
|
| 13 | + * From Kadet with love. |
|
| 14 | + */ |
|
| 15 | 15 | |
| 16 | 16 | namespace Kadet\Highlighter\Utils; |
| 17 | 17 | |
@@ -37,12 +37,12 @@ discard block |
||
| 37 | 37 | */ |
| 38 | 38 | public static function getLanguage($name) { |
| 39 | 39 | $embedded = []; |
| 40 | - if(($pos = strpos($name, '>')) !== false) { |
|
| 40 | + if (($pos = strpos($name, '>')) !== false) { |
|
| 41 | 41 | $embedded[] = self::getLanguage(trim(substr($name, $pos + 1))); |
| 42 | 42 | $name = trim(substr($name, 0, $pos)); |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | - if(!isset(self::$_languages[$name])) { |
|
| 45 | + if (!isset(self::$_languages[$name])) { |
|
| 46 | 46 | throw new \InvalidArgumentException("Language $name is not defined."); |
| 47 | 47 | } |
| 48 | 48 | |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | public static function highlight($source, $language, FormatterInterface $formatter = null) { |
| 69 | 69 | $formatter = $formatter ?: self::getDefaultFormatter(); |
| 70 | 70 | |
| 71 | - if(!$language instanceof Language) { |
|
| 71 | + if (!$language instanceof Language) { |
|
| 72 | 72 | $language = self::getLanguage($language); |
| 73 | 73 | } |
| 74 | 74 | |
@@ -80,8 +80,7 @@ discard block |
||
| 80 | 80 | |
| 81 | 81 | Highlighter::setDefaultFormatter( |
| 82 | 82 | php_sapi_name() === 'cli' ? |
| 83 | - new CliFormatter() : |
|
| 84 | - new HtmlFormatter() |
|
| 83 | + new CliFormatter() : new HtmlFormatter() |
|
| 85 | 84 | ); |
| 86 | 85 | |
| 87 | 86 | Highlighter::registerLanguage('Kadet\\Highlighter\\Language\\PhpLanguage', ['php']); |
@@ -1,16 +1,16 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Highlighter |
|
| 4 | - * |
|
| 5 | - * Copyright (C) 2015, Some right reserved. |
|
| 6 | - * @author Kacper "Kadet" Donat <[email protected]> |
|
| 7 | - * |
|
| 8 | - * Contact with author: |
|
| 9 | - * Xmpp: [email protected] |
|
| 10 | - * E-mail: [email protected] |
|
| 11 | - * |
|
| 12 | - * From Kadet with love. |
|
| 13 | - */ |
|
| 3 | + * Highlighter |
|
| 4 | + * |
|
| 5 | + * Copyright (C) 2015, Some right reserved. |
|
| 6 | + * @author Kacper "Kadet" Donat <[email protected]> |
|
| 7 | + * |
|
| 8 | + * Contact with author: |
|
| 9 | + * Xmpp: [email protected] |
|
| 10 | + * E-mail: [email protected] |
|
| 11 | + * |
|
| 12 | + * From Kadet with love. |
|
| 13 | + */ |
|
| 14 | 14 | |
| 15 | 15 | namespace Kadet\Highlighter\Language; |
| 16 | 16 | |