Passed
Push — master ( 5daeb2...510eff )
by Pierrick
06:18
created
src/Parser.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
             $macro->setParser($this);
36 36
         }
37 37
 
38
-        $this->macro[$macro->getName()] = [ $macro, 'execute' ];
38
+        $this->macro[$macro->getName()] = [$macro, 'execute'];
39 39
     }
40 40
 
41 41
     public function setVariable($name, $value)
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
                 $required  = $this->consumeOptionalAssignementOperator();
185 185
                 $realValue = $this->parseValue($required, $valueIsKey);
186 186
                 if ($valueIsKey) {
187
-                    return new ObjectNode([ $value => $realValue ]);
187
+                    return new ObjectNode([$value => $realValue]);
188 188
                 }
189 189
                 break;
190 190
             case Token::T_BOOL:
@@ -336,7 +336,7 @@  discard block
 block discarded – undo
336 336
                 return $value;
337 337
             }
338 338
 
339
-            $files = [ $path ];
339
+            $files = [$path];
340 340
         }
341 341
 
342 342
         $token = $this->token;
Please login to merge, or discard this patch.
src/Lexer.php 2 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -177,18 +177,18 @@
 block discarded – undo
177 177
 
178 178
             case (0x07FF & $bytes) == $bytes:
179 179
                 return chr(0xc0 | ($bytes >> 6))
180
-                     . chr(0x80 | ($bytes & 0x3F));
180
+                        . chr(0x80 | ($bytes & 0x3F));
181 181
 
182 182
             case (0xFFFF & $bytes) == $bytes:
183 183
                 return chr(0xe0 | ($bytes >> 12))
184
-                     . chr(0x80 | (($bytes >> 6) & 0x3F))
185
-                     . chr(0x80 | ($bytes & 0x3F));
184
+                        . chr(0x80 | (($bytes >> 6) & 0x3F))
185
+                        . chr(0x80 | ($bytes & 0x3F));
186 186
 
187 187
             default:
188 188
                 return chr(0xF0 | ($bytes >> 18))
189
-                     . chr(0x80 | (($bytes >> 12) & 0x3F))
190
-                     . chr(0x80 | (($bytes >> 6) & 0x3F))
191
-                     . chr(0x80 | ($bytes & 0x3F));
189
+                        . chr(0x80 | (($bytes >> 12) & 0x3F))
190
+                        . chr(0x80 | (($bytes >> 6) & 0x3F))
191
+                        . chr(0x80 | ($bytes & 0x3F));
192 192
         }
193 193
     }
194 194
 }
Please login to merge, or discard this patch.
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
             self::STATE_INITITAL => [
46 46
                 self::REGEX_SPACE      => false,
47 47
                 self::REGEX_COMMENT    => false,
48
-                self::REGEX_COMMENT_ML => function () {
48
+                self::REGEX_COMMENT_ML => function() {
49 49
                     $pos = strpos($this->content, '*/', $this->count);
50 50
                     if (false === $pos) {
51 51
                         $this->line += substr_count(substr($this->content, $this->count), "\n");
@@ -54,29 +54,29 @@  discard block
 block discarded – undo
54 54
                     $this->line += substr_count(substr($this->content, $this->count, $pos - $this->count + 2), "\n");
55 55
                     $this->count = $pos + 2;
56 56
                 },
57
-                self::REGEX_DQUOTE => function () {
57
+                self::REGEX_DQUOTE => function() {
58 58
                     $this->begin(self::STATE_INSTRING);
59 59
                     $this->textBuffer = '';
60 60
                 },
61
-                self::REGEX_BOOL => function (&$yylval) {
61
+                self::REGEX_BOOL => function(&$yylval) {
62 62
                     $yylval = TypeCaster::toBool($yylval);
63 63
 
64 64
                     return Token::T_BOOL;
65 65
                 },
66
-                self::REGEX_NULL => function (&$yylval) {
66
+                self::REGEX_NULL => function(&$yylval) {
67 67
                     $yylval = null;
68 68
 
69 69
                     return Token::T_NULL;
70 70
                 },
71
-                self::REGEX_NUM => function (&$yylval) {
71
+                self::REGEX_NUM => function(&$yylval) {
72 72
                     $yylval = TypeCaster::toNum($yylval);
73 73
 
74 74
                     return Token::T_NUM;
75 75
                 },
76
-                self::REGEX_NAME => function () {
76
+                self::REGEX_NAME => function() {
77 77
                     return Token::T_NAME;
78 78
                 },
79
-                self::REGEX_HEREDOC => function (&$yylval) {
79
+                self::REGEX_HEREDOC => function(&$yylval) {
80 80
                     $needle = "\n" . $yylval;
81 81
                     $pos = strpos($this->content, $needle, $this->count);
82 82
                     if (false === $pos) {
@@ -90,21 +90,21 @@  discard block
 block discarded – undo
90 90
 
91 91
                     return Token::T_END_STR;
92 92
                 },
93
-                self::REGEX_TOKEN => function ($yylval) {
93
+                self::REGEX_TOKEN => function($yylval) {
94 94
                     return $yylval;
95 95
                 },
96
-                self::REGEX_VAR => function () {
96
+                self::REGEX_VAR => function() {
97 97
                     return Token::T_VAR;
98 98
                 },
99
-                self::REGEX_ANY => function ($yylval) {
99
+                self::REGEX_ANY => function($yylval) {
100 100
                     $this->error('Unexpected char \'' . $yylval . '\'');
101 101
                 },
102
-                self::EOF => function () {
102
+                self::EOF => function() {
103 103
                     return Token::T_EOF;
104 104
                 },
105 105
             ],
106 106
             self::STATE_INSTRING => [
107
-                '[^\\\"$]+' => function (&$yylval) {
107
+                '[^\\\"$]+' => function(&$yylval) {
108 108
                     $this->textBuffer .= $yylval;
109 109
                     if ('$' == substr($this->content, $this->count, 1)) {
110 110
                         $yylval = $this->textBuffer;
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
                         return Token::T_STRING;
114 114
                     }
115 115
                 },
116
-                '?:\\\(.)' => function ($yylval) {
116
+                '?:\\\(.)' => function($yylval) {
117 117
                     switch ($yylval) {
118 118
                         case 'n':
119 119
                             $this->textBuffer .= "\n";
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
                             break;
147 147
                     }
148 148
                 },
149
-                '\$' => function (&$yylval) {
149
+                '\$' => function(&$yylval) {
150 150
                     if (preg_match('/^{([A-Za-z0-9_]+)}/', substr($this->content, $this->count), $matches)) {
151 151
                         $this->count += strlen($matches[0]);
152 152
                         $yylval = $matches[1];
@@ -156,13 +156,13 @@  discard block
 block discarded – undo
156 156
 
157 157
                     $this->textBuffer .= $yylval;
158 158
                 },
159
-                self::REGEX_DQUOTE => function (&$yylval) {
159
+                self::REGEX_DQUOTE => function(&$yylval) {
160 160
                     $yylval = $this->textBuffer;
161 161
                     $this->begin(self::STATE_INITITAL);
162 162
 
163 163
                     return Token::T_END_STR;
164 164
                 },
165
-                self::EOF => function () {
165
+                self::EOF => function() {
166 166
                     $this->error('Unterminated string');
167 167
                 },
168 168
             ],
Please login to merge, or discard this patch.
src/AbstractLexer.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@
 block discarded – undo
61 61
                 $this->line  += substr_count($matches[0], "\n");
62 62
             } else {
63 63
                 $i       = 0;
64
-                $matches = [ '' ];
64
+                $matches = [''];
65 65
             }
66 66
 
67 67
             if ($this->tokenMaps[$this->state][$i - 1]) {
Please login to merge, or discard this patch.