Passed
Push — master ( 7783b2...f247da )
by Kacper
02:40
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.
Matcher/CommentMatcher.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@
 block discarded – undo
52 52
         $all = [];
53 53
 
54 54
         foreach ($this->multiLine as $name => $comment) {
55
-            $comment = array_map(function ($e) { return preg_quote($e, '/'); }, $comment);
55
+            $comment = array_map(function($e) { return preg_quote($e, '/'); }, $comment);
56 56
 
57 57
             $all[] = [$name, "/{$comment[0]}(.*?){$comment[1]}/ms"];
58 58
         }
Please login to merge, or discard this patch.
Utils/Console.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
      * @return ConsoleHelper
28 28
      */
29 29
     public static function get() {
30
-        if(!isset(self::$_instance)) {
30
+        if (!isset(self::$_instance)) {
31 31
             self::$_instance = new ConsoleHelper();
32 32
         }
33 33
 
Please login to merge, or discard this patch.
Utils/ConsoleHelper.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
     ];
32 32
 
33 33
     public function styled($style, $text) {
34
-        return $this->open($style).$text.$this->close();
34
+        return $this->open($style) . $text . $this->close();
35 35
     }
36 36
 
37 37
     public function open($style)
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
     public function close()
49 49
     {
50 50
         $this->_current = empty($this->_stack) ? $this->_default : array_pop($this->_stack);
51
-        return "\033[0m".$this->_set(array_diff($this->_current, $this->_default));
51
+        return "\033[0m" . $this->_set(array_diff($this->_current, $this->_default));
52 52
     }
53 53
 
54 54
     private function _color($name, $bg = false)
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
     }
78 78
 
79 79
     private function _style($name, $value) {
80
-        switch($name) {
80
+        switch ($name) {
81 81
             case 'color':
82 82
                 return $this->_color($value);
83 83
             case 'background':
@@ -98,9 +98,9 @@  discard block
 block discarded – undo
98 98
     }
99 99
 
100 100
     private function _set($style) {
101
-        $escape = "\e[".implode(';', array_map(function($style, $name) {
101
+        $escape = "\e[" . implode(';', array_map(function($style, $name) {
102 102
             return $this->_style($style, $name);
103
-        }, array_keys($style), $style)).'m';
103
+        }, array_keys($style), $style)) . 'm';
104 104
 
105 105
         return $escape === "\e[m" ? null : $escape;
106 106
     }
Please login to merge, or discard this patch.
Utils/Singleton.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
      * @return ConsoleHelper
28 28
      */
29 29
     public static function get() {
30
-        if(!isset(self::$_instance)) {
30
+        if (!isset(self::$_instance)) {
31 31
             self::$_instance = new ConsoleHelper();
32 32
         }
33 33
 
Please login to merge, or discard this patch.
Parser/ContextualToken.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@
 block discarded – undo
41 41
 
42 42
     protected function validate(Language $language, $context)
43 43
     {
44
-        if($language !== $this->getRule()->language) {
44
+        if ($language !== $this->getRule()->language) {
45 45
             return false;
46 46
         }
47 47
 
Please login to merge, or discard this patch.
Parser/TokenList.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -56,10 +56,10 @@
 block discarded – undo
56 56
     public function sort() {
57 57
         ksort($this->_tokens);
58 58
 
59
-        foreach(array_keys($this->_pending) as $position) {
59
+        foreach (array_keys($this->_pending) as $position) {
60 60
             uasort(
61 61
                 $this->_tokens[$position],
62
-                Token::class.'::compare'
62
+                Token::class . '::compare'
63 63
             );
64 64
         }
65 65
         $this->_pending = [];
Please login to merge, or discard this patch.
Parser/Token.php 1 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/TokenFactory.php 1 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.