@@ -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 | |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | $js = new JavaScriptLanguage(); |
| 29 | 29 | |
| 30 | 30 | return array_merge(parent::getRules(), [ |
| 31 | - 'language.'.$js->getIdentifier() => [ |
|
| 31 | + 'language.' . $js->getIdentifier() => [ |
|
| 32 | 32 | new OpenRule(new RegexMatcher('/<script.*?>()/'), [ |
| 33 | 33 | 'factory' => new TokenFactory('Kadet\\Highlighter\\Parser\\LanguageToken'), |
| 34 | 34 | 'inject' => $js, |
@@ -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 | |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | */ |
| 37 | 37 | public static function getLanguage($name) { |
| 38 | 38 | $embedded = []; |
| 39 | - if(($pos = strpos($name, '>')) !== false) { |
|
| 39 | + if (($pos = strpos($name, '>')) !== false) { |
|
| 40 | 40 | $embedded[] = self::getLanguage(trim(substr($name, $pos + 1))); |
| 41 | 41 | $name = trim(substr($name, 0, $pos)); |
| 42 | 42 | } |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | public static function highlight($source, $language, FormatterInterface $formatter = null) { |
| 71 | 71 | $formatter = $formatter ?: self::getDefaultFormatter(); |
| 72 | 72 | |
| 73 | - if(!$language instanceof Language) { |
|
| 73 | + if (!$language instanceof Language) { |
|
| 74 | 74 | $language = self::getLanguage($language); |
| 75 | 75 | } |
| 76 | 76 | |
@@ -82,8 +82,7 @@ discard block |
||
| 82 | 82 | |
| 83 | 83 | KeyLighter::setDefaultFormatter( |
| 84 | 84 | php_sapi_name() === 'cli' ? |
| 85 | - new CliFormatter() : |
|
| 86 | - new HtmlFormatter() |
|
| 85 | + new CliFormatter() : new HtmlFormatter() |
|
| 87 | 86 | ); |
| 88 | 87 | |
| 89 | 88 | KeyLighter::registerLanguage('Kadet\\Highlighter\\Language\\PhpLanguage', ['php']); |