@@ -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 | |
@@ -158,6 +158,9 @@ discard block |
||
| 158 | 158 | return new TokenIterator($result, $tokens->getSource()); |
| 159 | 159 | } |
| 160 | 160 | |
| 161 | + /** |
|
| 162 | + * @param string $source |
|
| 163 | + */ |
|
| 161 | 164 | public function tokenize($source, $additional = [], $offset = 0, $embedded = false) |
| 162 | 165 | { |
| 163 | 166 | $iterator = new TokenIterator( |
@@ -197,7 +200,7 @@ discard block |
||
| 197 | 200 | /** |
| 198 | 201 | * @param bool $embedded |
| 199 | 202 | * |
| 200 | - * @return Rule[] |
|
| 203 | + * @return \Generator |
|
| 201 | 204 | */ |
| 202 | 205 | private function _rules($embedded = false) |
| 203 | 206 | { |
@@ -241,7 +244,7 @@ discard block |
||
| 241 | 244 | /** |
| 242 | 245 | * Language range Rule(s) |
| 243 | 246 | * |
| 244 | - * @return Rule|Rule[] |
|
| 247 | + * @return Rule |
|
| 245 | 248 | */ |
| 246 | 249 | public function getOpenClose() |
| 247 | 250 | { |
@@ -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 | |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | reset($rules); |
| 143 | 143 | while (list($rule, $type) = each($rules)) { |
| 144 | 144 | $matched = !($type & self::CONTEXT_EXACTLY) ? |
| 145 | - count(array_filter($context, function ($a) use ($rule) { |
|
| 145 | + count(array_filter($context, function($a) use ($rule) { |
|
| 146 | 146 | return $a === $rule || fnmatch($rule . '.*', $a); |
| 147 | 147 | })) > 0 : |
| 148 | 148 | in_array($rule, $context, true); |
@@ -173,7 +173,7 @@ discard block |
||
| 173 | 173 | private function _unsetUnnecessaryRules($rule, &$required) |
| 174 | 174 | { |
| 175 | 175 | if (strpos($rule, '.') !== false) { |
| 176 | - foreach (array_filter(array_keys($this->_context), function ($key) use ($rule) { |
|
| 176 | + foreach (array_filter(array_keys($this->_context), function($key) use ($rule) { |
|
| 177 | 177 | return fnmatch($key . '.*', $rule); |
| 178 | 178 | }) as $remove) { |
| 179 | 179 | unset($required[$remove]); |
@@ -195,7 +195,7 @@ discard block |
||
| 195 | 195 | { |
| 196 | 196 | static $callable; |
| 197 | 197 | if (!$callable) { |
| 198 | - $callable = function () { |
|
| 198 | + $callable = function() { |
|
| 199 | 199 | return true; |
| 200 | 200 | }; |
| 201 | 201 | } |
@@ -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,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 | |
@@ -113,7 +113,7 @@ |
||
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | /** |
| 116 | - * @param mixed $class |
|
| 116 | + * @param string $class |
|
| 117 | 117 | * |
| 118 | 118 | * @throws \InvalidArgumentException |
| 119 | 119 | */ |
@@ -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) 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 | |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | * @param $styles |
| 36 | 36 | */ |
| 37 | 37 | public function __construct($styles = false) { |
| 38 | - $this->_styles = $styles ?: include __DIR__.'/../Styles/Cli/Default.php'; |
|
| 38 | + $this->_styles = $styles ?: include __DIR__ . '/../Styles/Cli/Default.php'; |
|
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | public function format(TokenIterator $tokens) |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | |
| 56 | 56 | $last = $token->pos; |
| 57 | 57 | } |
| 58 | - $result .= substr($source, $last).Console::reset(); |
|
| 58 | + $result .= substr($source, $last) . Console::reset(); |
|
| 59 | 59 | |
| 60 | 60 | return $result; |
| 61 | 61 | } |
@@ -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 | |