Passed
Push — master ( b83039...7783b2 )
by Kacper
02:48
created
Language/PlainText.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) 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
 
Please login to merge, or discard this patch.
Language/TokenDump.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) 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
 
Please login to merge, or discard this patch.
Language/Language.php 3 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
- *
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
 
Please login to merge, or discard this patch.
Doc Comments   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -158,6 +158,9 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
     {
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -140,7 +140,7 @@
 block discarded – undo
140 140
                     } else {
141 141
                         /** @noinspection PhpUnusedParameterInspection */
142 142
                         $start = ArrayHelper::find(
143
-                            array_reverse($context), function ($k, $v) use ($token) {
143
+                            array_reverse($context), function($k, $v) use ($token) {
144 144
                             return $v === $token->name;
145 145
                         });
146 146
 
Please login to merge, or discard this patch.
Parser/Token.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
- *
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
 
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -91,19 +91,19 @@
 block discarded – undo
91 91
         $multiplier = $a->isEnd() ? -1 : 1;
92 92
 
93 93
         if (($a->isStart() && $b->isEnd()) || ($a->isEnd() && $b->isStart())) {
94
-            if($a->getStart() == $b) {
94
+            if ($a->getStart() == $b) {
95 95
                 return 1;
96
-            } elseif($a->getEnd() == $b) {
96
+            } elseif ($a->getEnd() == $b) {
97 97
                 return -1;
98 98
             } else {
99 99
                 return $multiplier;
100 100
             }
101 101
         } elseif (($rule = Helper::cmp($b->_rule->priority, $a->_rule->priority)) !== 0) {
102
-            return $multiplier*$rule;
102
+            return $multiplier * $rule;
103 103
         } elseif (($rule = Helper::cmp($b->index, $a->index)) !== 0) {
104
-            return $multiplier*$rule;
104
+            return $multiplier * $rule;
105 105
         } else {
106
-            return $multiplier*($a->id < $b->id ? -1 : 1);
106
+            return $multiplier * ($a->id < $b->id ? -1 : 1);
107 107
         }
108 108
     }
109 109
 
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) 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
 
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) 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
 
Please login to merge, or discard this patch.
Parser/TokenFactoryInterface.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) 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
 
Please login to merge, or discard this patch.
Parser/LanguageToken.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
- *
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
 
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -34,9 +34,9 @@
 block discarded – undo
34 34
 
35 35
         if ($this->isStart()) {
36 36
             $lang = $this->_rule->language;
37
-            if($lang === null && $this->getInjected() !== $language) {
37
+            if ($lang === null && $this->getInjected() !== $language) {
38 38
                 $valid = true;
39
-            } elseif($language === $lang && $this->_rule->validateContext($context)) {
39
+            } elseif ($language === $lang && $this->_rule->validateContext($context)) {
40 40
                 $valid = true;
41 41
             }
42 42
         } else {
Please login to merge, or discard this patch.
Parser/TokenFactory.php 3 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
- *
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
 
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -113,7 +113,7 @@
 block discarded – undo
113 113
     }
114 114
 
115 115
     /**
116
-     * @param mixed $class
116
+     * @param string $class
117 117
      *
118 118
      * @throws \InvalidArgumentException
119 119
      */
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -46,11 +46,11 @@  discard block
 block discarded – undo
46 46
      */
47 47
     public function create($params) {
48 48
         $params[0] = !empty($params[0]) ? $this->getName($params[0]) : $this->_base;
49
-        if(empty($params['rule'])) {
49
+        if (empty($params['rule'])) {
50 50
             $params['rule'] = $this->_rule;
51 51
         }
52 52
 
53
-        if(isset($params['pos'])) {
53
+        if (isset($params['pos'])) {
54 54
             $params['pos'] += $this->_offset;
55 55
         }
56 56
 
@@ -66,11 +66,11 @@  discard block
 block discarded – undo
66 66
         /** @var Token $token */
67 67
         $token = new $this->_class($params);
68 68
 
69
-        if($this->_type == 0x3) {
69
+        if ($this->_type == 0x3) {
70 70
             return $token;
71 71
         }
72 72
 
73
-        if($this->_type === Token::START) {
73
+        if ($this->_type === Token::START) {
74 74
             $token->setEnd(false);
75 75
             return $token;
76 76
         } else {
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
      */
120 120
     public function setClass($class)
121 121
     {
122
-        if(!is_a($class, 'Kadet\Highlighter\Parser\Token', true)) {
122
+        if (!is_a($class, 'Kadet\Highlighter\Parser\Token', true)) {
123 123
             throw new \InvalidArgumentException('$class must extend Kadet\Highlighter\Parser\Token');
124 124
         }
125 125
 
Please login to merge, or discard this patch.