Passed
Branch 0.8-dev (82421f)
by Kacper
02:45
created
Parser/Validator/Validator.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) 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.
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -44,11 +44,11 @@  discard block
 block discarded – undo
44 44
 
45 45
     public function setRules($rules)
46 46
     {
47
-        if(empty($rules)) {
48
-            $this->_rules = [ 'none' => Validator::CONTEXT_IN_ONE_OF ];
47
+        if (empty($rules)) {
48
+            $this->_rules = ['none' => Validator::CONTEXT_IN_ONE_OF];
49 49
         } else {
50 50
             foreach ($rules as $key => $rule) {
51
-                list($plain, $type)     = $this->_parse($rule);
51
+                list($plain, $type) = $this->_parse($rule);
52 52
                 $this->_rules[$plain] = $type;
53 53
             }
54 54
         }
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
     private function _clean($rule, &$required)
58 58
     {
59 59
         if (strpos($rule, '.') !== false) {
60
-            foreach (array_filter(array_keys($required), function ($key) use ($rule) {
60
+            foreach (array_filter(array_keys($required), function($key) use ($rule) {
61 61
                 return fnmatch($key . '.*', $rule);
62 62
             }) as $remove) {
63 63
                 unset($required[$remove]);
@@ -66,11 +66,11 @@  discard block
 block discarded – undo
66 66
     }
67 67
 
68 68
     protected function _validate($context, $rules, $result = false) {
69
-        if(empty($context)) {
69
+        if (empty($context)) {
70 70
             $context = ['none'];
71 71
         }
72 72
 
73
-        while(list($rule, $type) = each($rules)) {
73
+        while (list($rule, $type) = each($rules)) {
74 74
             $matched = $this->_matches($context, $rule, $type);
75 75
 
76 76
             if ($type & Validator::CONTEXT_NOT_IN) {
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
 
124 124
         $rule = substr($rule, $pos);
125 125
 
126
-        if($type & self::CONTEXT_REGEX) {
126
+        if ($type & self::CONTEXT_REGEX) {
127 127
             $rule = "/^$rule(\\.\\w+)?/i";
128 128
         }
129 129
 
@@ -131,22 +131,22 @@  discard block
 block discarded – undo
131 131
     }
132 132
 
133 133
     private function _matches($context, $rule, $type) {
134
-        if($type & self::CONTEXT_EXACTLY) {
134
+        if ($type & self::CONTEXT_EXACTLY) {
135 135
             return in_array($rule, $context, true);
136
-        } elseif($type & self::CONTEXT_REGEX) {
137
-            foreach($context as $item) {
138
-                if(preg_match($rule, $item)) {
136
+        } elseif ($type & self::CONTEXT_REGEX) {
137
+            foreach ($context as $item) {
138
+                if (preg_match($rule, $item)) {
139 139
                     return true;
140 140
                 }
141 141
             }
142 142
             return false;
143 143
         } else {
144
-            if(in_array($rule, $context, true)) {
144
+            if (in_array($rule, $context, true)) {
145 145
                 return true;
146 146
             }
147 147
 
148
-            foreach($context as $item) {
149
-                if(fnmatch("$rule.*", $item)) {
148
+            foreach ($context as $item) {
149
+                if (fnmatch("$rule.*", $item)) {
150 150
                     return true;
151 151
                 }
152 152
             }
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
     {
159 159
         static $validator;
160 160
         if (!$validator) {
161
-            $validator = new DelegateValidator(function () {
161
+            $validator = new DelegateValidator(function() {
162 162
                 return true;
163 163
             });
164 164
         }
Please login to merge, or discard this patch.
Parser/Validator/DelegateValidator.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/Css/Less.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/Css/PreProcessor.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.
Parser/Rules.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) 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.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -107,7 +107,7 @@
 block discarded – undo
107 107
     public function all()
108 108
     {
109 109
         $items = $this->getArrayCopy();
110
-        if(empty($items)) return [];
110
+        if (empty($items)) return [];
111 111
 
112 112
         return call_user_func_array('array_merge', $items);
113 113
     }
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -107,7 +107,9 @@
 block discarded – undo
107 107
     public function all()
108 108
     {
109 109
         $items = $this->getArrayCopy();
110
-        if(empty($items)) return [];
110
+        if(empty($items)) {
111
+            return [];
112
+        }
111 113
 
112 114
         return call_user_func_array('array_merge', $items);
113 115
     }
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) 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.
Parser/TokenFactory.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) 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.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
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
         if ($name !== null) {
54 54
             $name = $this->getName($name);
@@ -72,29 +72,29 @@  discard block
 block discarded – undo
72 72
     }
73 73
 
74 74
     private function link($name, $params) {
75
-        if($this->_type & Token::START) {
76
-            if(!isset($params['start'])) {
75
+        if ($this->_type & Token::START) {
76
+            if (!isset($params['start'])) {
77 77
                 $params['start'] = new $params['class']($name, $params);
78 78
             }
79 79
 
80
-            if($this->_type === Token::START) {
80
+            if ($this->_type === Token::START) {
81 81
                 $params['start']->setEnd(false);
82 82
                 return $params['start'];
83 83
             }
84 84
         }
85 85
 
86
-        if($this->_type & Token::END) {
86
+        if ($this->_type & Token::END) {
87 87
             if (isset($params['length'])) {
88 88
                 $end = $params;
89 89
                 $end['pos'] += $params['length'];
90 90
 
91 91
                 /** @var Token $end */
92 92
                 $params['end'] = new $params['class']($name, $end);
93
-            } elseif(!isset($params['end'])) {
93
+            } elseif (!isset($params['end'])) {
94 94
                 $params['end'] = new $params['class']($name, $params);
95 95
             }
96 96
 
97
-            if($this->_type === Token::END) {
97
+            if ($this->_type === Token::END) {
98 98
                 $params['end']->setStart(false);
99 99
                 return $params['end'];
100 100
             }
Please login to merge, or discard this patch.
Parser/Token/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) 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.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@
 block discarded – undo
32 32
 {
33 33
     public function __construct($name, $options = []) {
34 34
         parent::__construct($name, $options);
35
-        if(isset($options['inject'])) {
35
+        if (isset($options['inject'])) {
36 36
             $this->inject = $options['inject'];
37 37
         }
38 38
     }
Please login to merge, or discard this patch.
Utils/Console.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.