@@ -34,7 +34,7 @@ |
||
34 | 34 | ], $options); |
35 | 35 | |
36 | 36 | if ($options['escape']) { |
37 | - $words = array_map(function ($word) { |
|
37 | + $words = array_map(function($word) { |
|
38 | 38 | return preg_quote($word, '/'); |
39 | 39 | }, $words); |
40 | 40 | } |
@@ -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 |
@@ -45,14 +45,14 @@ |
||
45 | 45 | |
46 | 46 | public static function rearrange(array $array, array $keys) |
47 | 47 | { |
48 | - return array_combine($keys, array_map(function ($key) use ($array) { |
|
48 | + return array_combine($keys, array_map(function($key) use ($array) { |
|
49 | 49 | return $array[$key]; |
50 | 50 | }, $keys)); |
51 | 51 | } |
52 | 52 | |
53 | 53 | public static function column(array $array, $index) |
54 | 54 | { |
55 | - return array_map(function ($e) use ($index) { return $e[$index]; }, $array); |
|
55 | + return array_map(function($e) use ($index) { return $e[$index]; }, $array); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | public static function find(array $array, callable $tester) |
@@ -1,17 +1,17 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Highlighter |
|
4 | - *1 |
|
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 | + *1 |
|
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\Matcher; |
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 | - * |
|
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 |
@@ -62,7 +62,7 @@ |
||
62 | 62 | |
63 | 63 | /** |
64 | 64 | * @param Language|callable|string $language |
65 | - * @param array[string] $aliases |
|
65 | + * @param string[] $aliases |
|
66 | 66 | */ |
67 | 67 | public function registerLanguage($language, $aliases) { |
68 | 68 | $this->_languages = array_merge($this->_languages, array_fill_keys($aliases, $language)); |
@@ -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 |
@@ -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) 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 |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | * |
49 | 49 | * @return false|Token|null |
50 | 50 | */ |
51 | - public function create($name, $params = [ ]) |
|
51 | + public function create($name, $params = []) |
|
52 | 52 | { |
53 | 53 | $name = $name !== null ? $this->getName($name) : $this->_base; |
54 | 54 | |
@@ -61,24 +61,24 @@ discard block |
||
61 | 61 | } |
62 | 62 | |
63 | 63 | $class = isset($params['class']) ? $params['class'] : $this->_class; |
64 | - $end = isset($params['end']) ? $params['end'] : null; |
|
64 | + $end = isset($params['end']) ? $params['end'] : null; |
|
65 | 65 | $start = isset($params['start']) ? $params['start'] : null; |
66 | 66 | |
67 | 67 | // we don't want to pass that into token |
68 | 68 | unset($params['class'], $params['end'], $params['start']); |
69 | 69 | |
70 | - if($this->_type & Token::START) { |
|
71 | - if($start === null) { |
|
70 | + if ($this->_type & Token::START) { |
|
71 | + if ($start === null) { |
|
72 | 72 | $start = new $class($name, $params); |
73 | 73 | } |
74 | 74 | |
75 | - if($this->_type === Token::START) { |
|
75 | + if ($this->_type === Token::START) { |
|
76 | 76 | $start->setEnd(false); |
77 | 77 | return $start; |
78 | 78 | } |
79 | 79 | } |
80 | 80 | |
81 | - if($this->_type & Token::END) { |
|
81 | + if ($this->_type & Token::END) { |
|
82 | 82 | if (isset($params['length'])) { |
83 | 83 | $length = $params['length']; |
84 | 84 | unset($params['length']); |
@@ -88,11 +88,11 @@ discard block |
||
88 | 88 | |
89 | 89 | /** @var Token $end */ |
90 | 90 | $end = new $class($name, $end); |
91 | - } elseif($end === null) { |
|
91 | + } elseif ($end === null) { |
|
92 | 92 | $end = new $class($name, $params); |
93 | 93 | } |
94 | 94 | |
95 | - if($this->_type === Token::END || $start === null) { |
|
95 | + if ($this->_type === Token::END || $start === null) { |
|
96 | 96 | $end->setStart(false); |
97 | 97 | return $end; |
98 | 98 | } |
@@ -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 | - * |
|
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 | - * |
|
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 | - * |
|
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 |
@@ -69,7 +69,7 @@ |
||
69 | 69 | new CloseRule(new SubStringMatcher(')')), |
70 | 70 | ], |
71 | 71 | |
72 | - 'keyword.at-rule' => new Rule(new RegexMatcher('/(@(?:-[a-z]+-)?(?:'.implode('|', $at).'))/'), [ |
|
72 | + 'keyword.at-rule' => new Rule(new RegexMatcher('/(@(?:-[a-z]+-)?(?:' . implode('|', $at) . '))/'), [ |
|
73 | 73 | 'priority' => 2 |
74 | 74 | ]), |
75 | 75 |