Completed
Branch 0.8-dev (5d9532)
by Kacper
02:49
created
Formatter/HtmlFormatter.php 1 patch
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -1,17 +1,17 @@
 block discarded – undo
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\Formatter;
17 17
 
Please login to merge, or discard this patch.
Formatter/FormatterInterface.php 1 patch
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -1,17 +1,17 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
Language/Php.php 1 patch
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -1,16 +1,16 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Highlighter
4
- *
5
- * Copyright (C) 2016, 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) 2016, 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
 
Please login to merge, or discard this patch.
Utils/Helper.php 1 patch
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -1,17 +1,17 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
Matcher/WholeMatcher.php 1 patch
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -1,17 +1,17 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
Parser/OpenRule.php 1 patch
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -1,17 +1,17 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
Parser/CloseRule.php 1 patch
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -1,17 +1,17 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
Parser/Token/ContextualToken.php 2 patches
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -1,17 +1,17 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@
 block discarded – undo
43 43
                 $this->_end->_valid = false;
44 44
             }
45 45
         } else {
46
-            if (!$this->rule->validator->validate($context, [ $this->name => Validator::CONTEXT_IN ])) {
46
+            if (!$this->rule->validator->validate($context, [$this->name => Validator::CONTEXT_IN])) {
47 47
                 $this->setValid(false);
48 48
             } else {
49 49
                 $this->_valid       = false;
Please login to merge, or discard this patch.
Parser/Token/Token.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -151,7 +151,7 @@
 block discarded – undo
151 151
     }
152 152
 
153 153
     /**
154
-     * @return Token|null|false
154
+     * @return Token
155 155
      */
156 156
     public function getEnd()
157 157
     {
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -85,7 +85,7 @@
 block discarded – undo
85 85
         return $this->_end === null;
86 86
     }
87 87
 
88
-     public function isValid(Context $context)
88
+        public function isValid(Context $context)
89 89
     {
90 90
         if ($this->_valid === null) {
91 91
             $this->validate($context);
Please login to merge, or discard this patch.
Spacing   +7 added lines, -8 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
      */
61 61
     public function __construct($name = null, array $options = [])
62 62
     {
63
-        $this->name     = $name;
63
+        $this->name = $name;
64 64
 
65 65
         if (isset($options['pos'])) {
66 66
             $this->pos = $options['pos'];
@@ -182,13 +182,12 @@  discard block
 block discarded – undo
182 182
      * @return bool Return true to continue processing, false to return already processed tokens.
183 183
      */
184 184
     public function process(Context $context, Language $language, Result $result, TokenIterator $tokens) {
185
-        if(!$this->isValid($context)) {
185
+        if (!$this->isValid($context)) {
186 186
             return true;
187 187
         }
188 188
 
189 189
         return $this->isStart() ?
190
-            $this->processStart($context, $language, $result, $tokens) :
191
-            $this->processEnd($context, $language, $result, $tokens);
190
+            $this->processStart($context, $language, $result, $tokens) : $this->processEnd($context, $language, $result, $tokens);
192 191
     }
193 192
 
194 193
     protected function processStart(Context $context, Language $language, Result $result, TokenIterator $tokens) {
@@ -199,7 +198,7 @@  discard block
 block discarded – undo
199 198
     }
200 199
 
201 200
     protected function processEnd(Context $context, Language $language, Result $result, TokenIterator $tokens) {
202
-        if($this->_start) {
201
+        if ($this->_start) {
203 202
             $context->pop($this->_start);
204 203
         } else {
205 204
             if (($start = $context->find($this->name)) !== false) {
@@ -229,11 +228,11 @@  discard block
 block discarded – undo
229 228
                 return $multiplier;
230 229
             }
231 230
         } elseif (($rule = Helper::cmp($b->rule->priority, $a->rule->priority)) !== 0) {
232
-            return $multiplier*$rule;
231
+            return $multiplier * $rule;
233 232
         } elseif (($rule = Helper::cmp($b->index, $a->index)) !== 0) {
234
-            return $multiplier*$rule;
233
+            return $multiplier * $rule;
235 234
         } else {
236
-            return $multiplier*($a->id < $b->id ? -1 : 1);
235
+            return $multiplier * ($a->id < $b->id ? -1 : 1);
237 236
         }
238 237
     }
239 238
 }
Please login to merge, or discard this patch.