Test Failed
Push — master ( 2bc697...ec556c )
by Maciej
02:06
created
Matcher/WordMatcher.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@
 block discarded – undo
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
         }
Please login to merge, or discard this patch.
Language/Sql.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@
 block discarded – undo
40 40
         'INTERSECT', 'INTERVAL', 'INTO', 'IS', 'ITERATE', 'LANGUAGE', 'LARGE', 'LATERAL', 'LEADING',
41 41
         'LEAVE', 'LEFT', 'LIKE', 'LOCAL', 'LOOP', 'MATCH', 'MEMBER', 'MERGE', 'METHOD', 'MODIFIES',
42 42
         'MODULE', 'MONTH', 'MULTISET', 'NATIONAL', 'NATURAL', 'NCHAR', 'NCLOB', 'NEW', 'NO', 'NONE', 'NOT',
43
-        'OF', 'OLD', 'ON', 'ONLY', 'OPEN', 'OR', 'ORDER', 'OUT','OUTER', 'OUTPUT', 'OVER',
43
+        'OF', 'OLD', 'ON', 'ONLY', 'OPEN', 'OR', 'ORDER', 'OUT', 'OUTER', 'OUTPUT', 'OVER',
44 44
         'OVERLAPS', 'PARAMETER', 'PARTITION', 'PRECISION', 'PREPARE', 'PRIMARY', 'PROCEDURE', 'RANGE', 'READS',
45 45
         'RECURSIVE', 'REF', 'REFERENCES', 'REFERENCING', 'RELEASE',
46 46
         'REPEAT', 'RESIGNAL', 'RESULT', 'RETURN', 'RETURNS', 'REVOKE', 'RIGHT', 'ROLLBACK', 'ROLLUP', 'ROW',
Please login to merge, or discard this patch.
Parser/Token/Token.php 2 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.
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -185,8 +185,7 @@
 block discarded – undo
185 185
         }
186 186
 
187 187
         return $this->isStart() ?
188
-            $this->processStart($context, $language, $result, $tokens) :
189
-            $this->processEnd($context, $language, $result, $tokens);
188
+            $this->processStart($context, $language, $result, $tokens) : $this->processEnd($context, $language, $result, $tokens);
190 189
     }
191 190
 
192 191
     protected function processStart(Context $context, Language $language, Result $result, TokenIterator $tokens)
Please login to merge, or discard this patch.
Parser/Token/ContextualToken.php 1 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/Result.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
         $this->_source = $source;
29 29
         $this->_start  = $start;
30 30
 
31
-        parent::__construct($start !== null ? [ $start->id => $start ] : [], 0, \ArrayIterator::class);
31
+        parent::__construct($start !== null ? [$start->id => $start] : [], 0, \ArrayIterator::class);
32 32
     }
33 33
 
34 34
     public function getSource()
Please login to merge, or discard this patch.
Matcher/DelegateRegexMatcher.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@
 block discarded – undo
25 25
     /**
26 26
      * RegexMatcher constructor.
27 27
      *
28
-     * @param          $regex
28
+     * @param          string $regex
29 29
      * @param callable $callable
30 30
      */
31 31
     public function __construct($regex, callable $callable)
Please login to merge, or discard this patch.
KeyLighter.php 2 patches
Spacing   +8 added lines, -10 removed lines patch added patch discarded remove patch
@@ -70,21 +70,19 @@  discard block
 block discarded – undo
70 70
     public function languageByName($name, $params = [])
71 71
     {
72 72
         return isset($this->_languages['name'][$name]) ?
73
-            $this->_languages['name'][$name]($params) :
74
-            new PlainText($params);
73
+            $this->_languages['name'][$name]($params) : new PlainText($params);
75 74
     }
76 75
 
77 76
     public function languageByMime($mime, $params = [])
78 77
     {
79 78
         return isset($this->_languages['mime'][$mime]) ?
80
-            $this->_languages['mime'][$mime]($params) :
81
-            new PlainText($params);
79
+            $this->_languages['mime'][$mime]($params) : new PlainText($params);
82 80
     }
83 81
 
84 82
     public function languageByExt($filename, $params = [])
85 83
     {
86
-        foreach($this->_languages['extension'] as $mask => $class) {
87
-            if(fnmatch($mask, $filename)) {
84
+        foreach ($this->_languages['extension'] as $mask => $class) {
85
+            if (fnmatch($mask, $filename)) {
88 86
                 return $class($params);
89 87
             }
90 88
         }
@@ -110,7 +108,7 @@  discard block
 block discarded – undo
110 108
 
111 109
     public function registeredLanguages($by = 'name', $class = false)
112 110
     {
113
-        return array_map(function ($e) use($class) {
111
+        return array_map(function($e) use($class) {
114 112
             return $e([])->getFQN($class);
115 113
         }, $this->_languages[$by]);
116 114
     }
@@ -150,7 +148,7 @@  discard block
 block discarded – undo
150 148
 
151 149
     public function init()
152 150
     {
153
-        foreach(include __DIR__.'/Config/metadata.php' as $alias) {
151
+        foreach (include __DIR__.'/Config/metadata.php' as $alias) {
154 152
             $class = $alias[0];
155 153
             unset($alias[0]);
156 154
 
@@ -166,13 +164,13 @@  discard block
 block discarded – undo
166 164
      */
167 165
     public function register($class, array $options)
168 166
     {
169
-        if(!is_callable($class) && is_subclass_of($class, Language::class)) {
167
+        if (!is_callable($class) && is_subclass_of($class, Language::class)) {
170 168
             $class = function($arguments = []) use ($class) {
171 169
                 return new $class($arguments);
172 170
             };
173 171
         }
174 172
 
175
-        foreach(array_intersect_key($options, array_flip(['name', 'mime', 'extension'])) as $name => $values) {
173
+        foreach (array_intersect_key($options, array_flip(['name', 'mime', 'extension'])) as $name => $values) {
176 174
             $this->_languages[$name] = array_merge($this->_languages[$name], array_fill_keys($values, $class));
177 175
         }
178 176
     }
Please login to merge, or discard this patch.
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -135,6 +135,9 @@
 block discarded – undo
135 135
         return $this->_formatters;
136 136
     }
137 137
 
138
+    /**
139
+     * @return string
140
+     */
138 141
     public function highlight($source, Language $language, FormatterInterface $formatter = null)
139 142
     {
140 143
         $formatter = $formatter ?: $this->getDefaultFormatter();
Please login to merge, or discard this patch.
Language/Xml.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -36,14 +36,14 @@
 block discarded – undo
36 36
                 new OpenRule(new RegexMatcher('/(<[\w\.-]+)[:\/>:\s]/')),
37 37
                 new CloseRule(new SubStringMatcher('>'), ['context' => ['!string', '!comment']])
38 38
             ],
39
-            'tag.close' => new Rule(new RegexMatcher('/(<\/' . self::IDENTIFIER . '>)/')),
39
+            'tag.close' => new Rule(new RegexMatcher('/(<\/'.self::IDENTIFIER.'>)/')),
40 40
 
41
-            'symbol.tag' => new Rule(new RegexMatcher('/<\\/?' . self::IDENTIFIER . '/', [
41
+            'symbol.tag' => new Rule(new RegexMatcher('/<\\/?'.self::IDENTIFIER.'/', [
42 42
                 'name'      => Token::NAME,
43 43
                 'namespace' => '$.namespace'
44 44
             ]), ['context' => ['tag', '!string']]),
45 45
 
46
-            'symbol.attribute' => new Rule(new RegexMatcher('/' . self::IDENTIFIER . '=/', [
46
+            'symbol.attribute' => new Rule(new RegexMatcher('/'.self::IDENTIFIER.'=/', [
47 47
                 'name'      => Token::NAME,
48 48
                 'namespace' => '$.namespace'
49 49
             ]), ['context' => ['tag', '!string']]),
Please login to merge, or discard this patch.
Utils/ArrayHelper.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -19,14 +19,14 @@
 block discarded – undo
19 19
 {
20 20
     public static function rearrange(array $array, array $keys)
21 21
     {
22
-        return array_combine($keys, array_map(function ($key) use ($array) {
22
+        return array_combine($keys, array_map(function($key) use ($array) {
23 23
             return $array[$key];
24 24
         }, $keys));
25 25
     }
26 26
 
27 27
     public static function column(array $array, $index)
28 28
     {
29
-        return array_map(function ($e) use ($index) { return $e[$index]; }, $array);
29
+        return array_map(function($e) use ($index) { return $e[$index]; }, $array);
30 30
     }
31 31
 
32 32
     public static function find(array $array, callable $tester)
Please login to merge, or discard this patch.