Completed
Pull Request — master (#7)
by Tomáš
13:27 queued 06:59
created
src/Ruleset.php 2 patches
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -846,7 +846,7 @@  discard block
 block discarded – undo
846 846
 
847 847
                     if (isset($this->ruleset[$code]) === false) {
848 848
                         $this->ruleset[$code] = array(
849
-                                                 'properties' => array(),
849
+                                                    'properties' => array(),
850 850
                                                 );
851 851
                     } else if (isset($this->ruleset[$code]['properties']) === false) {
852 852
                         $this->ruleset[$code]['properties'] = array();
@@ -1084,8 +1084,8 @@  discard block
 block discarded – undo
1084 1084
             $patterns       = $this->getIgnorePatterns($sniffCode);
1085 1085
             foreach ($patterns as $pattern => $type) {
1086 1086
                 $replacements = array(
1087
-                                 '\\,' => ',',
1088
-                                 '*'   => '.*',
1087
+                                    '\\,' => ',',
1088
+                                    '*'   => '.*',
1089 1089
                                 );
1090 1090
 
1091 1091
                 $ignorePatterns[] = strtr($pattern, $replacements);
@@ -1095,8 +1095,8 @@  discard block
 block discarded – undo
1095 1095
             $patterns        = $this->getIncludePatterns($sniffCode);
1096 1096
             foreach ($patterns as $pattern => $type) {
1097 1097
                 $replacements = array(
1098
-                                 '\\,' => ',',
1099
-                                 '*'   => '.*',
1098
+                                    '\\,' => ',',
1099
+                                    '*'   => '.*',
1100 1100
                                 );
1101 1101
 
1102 1102
                 $includePatterns[] = strtr($pattern, $replacements);
@@ -1109,12 +1109,12 @@  discard block
 block discarded – undo
1109 1109
 
1110 1110
                 if (isset($this->tokenListeners[$token][$sniffClass]) === false) {
1111 1111
                     $this->tokenListeners[$token][$sniffClass] = array(
1112
-                                                                  'class'      => $sniffClass,
1113
-                                                                  'source'     => $sniffCode,
1114
-                                                                  'tokenizers' => $tokenizers,
1115
-                                                                  'ignore'     => $ignorePatterns,
1116
-                                                                  'include'    => $includePatterns,
1117
-                                                                 );
1112
+                                                                    'class'      => $sniffClass,
1113
+                                                                    'source'     => $sniffCode,
1114
+                                                                    'tokenizers' => $tokenizers,
1115
+                                                                    'ignore'     => $ignorePatterns,
1116
+                                                                    'include'    => $includePatterns,
1117
+                                                                    );
1118 1118
                 }
1119 1119
             }
1120 1120
         }//end foreach
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
      * @return string[]
262 262
      * @throws RuntimeException If the ruleset path is invalid.
263 263
      */
264
-    public function processRuleset($rulesetPath, $depth=0)
264
+    public function processRuleset($rulesetPath, $depth = 0)
265 265
     {
266 266
         $rulesetPath = Util\Common::realpath($rulesetPath);
267 267
         if (PHP_CODESNIFFER_VERBOSITY > 1) {
@@ -506,7 +506,7 @@  discard block
 block discarded – undo
506 506
      *
507 507
      * @return array
508 508
      */
509
-    private function expandSniffDirectory($directory, $depth=0)
509
+    private function expandSniffDirectory($directory, $depth = 0)
510 510
     {
511 511
         $sniffs = array();
512 512
 
@@ -569,7 +569,7 @@  discard block
 block discarded – undo
569 569
      * @return array
570 570
      * @throws RuntimeException If the reference is invalid.
571 571
      */
572
-    private function expandRulesetReference($ref, $rulesetDir, $depth=0)
572
+    private function expandRulesetReference($ref, $rulesetDir, $depth = 0)
573 573
     {
574 574
         // Ignore internal sniffs codes as they are used to only
575 575
         // hide and change internal messages.
@@ -751,7 +751,7 @@  discard block
 block discarded – undo
751 751
      * @return void
752 752
      * @throws RuntimeException If rule settings are invalid.
753 753
      */
754
-    private function processRule($rule, $newSniffs, $depth=0)
754
+    private function processRule($rule, $newSniffs, $depth = 0)
755 755
     {
756 756
         $ref  = (string) $rule['ref'];
757 757
         $todo = array($ref);
@@ -861,7 +861,7 @@  discard block
 block discarded – undo
861 861
                         foreach (explode(',', $value) as $val) {
862 862
                             $v = '';
863 863
 
864
-                            list($k,$v) = explode('=>', $val.'=>');
864
+                            list($k, $v) = explode('=>', $val.'=>');
865 865
                             if ($v !== '') {
866 866
                                 $values[$k] = $v;
867 867
                             } else {
@@ -1166,7 +1166,7 @@  discard block
 block discarded – undo
1166 1166
      *
1167 1167
      * @return array
1168 1168
      */
1169
-    public function getIgnorePatterns($listener=null)
1169
+    public function getIgnorePatterns($listener = null)
1170 1170
     {
1171 1171
         if ($listener === null) {
1172 1172
             return $this->ignorePatterns;
@@ -1192,7 +1192,7 @@  discard block
 block discarded – undo
1192 1192
      *
1193 1193
      * @return array
1194 1194
      */
1195
-    public function getIncludePatterns($listener=null)
1195
+    public function getIncludePatterns($listener = null)
1196 1196
     {
1197 1197
         if ($listener === null) {
1198 1198
             return $this->includePatterns;
Please login to merge, or discard this patch.
src/Util/Timing.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@
 block discarded – undo
48 48
      *
49 49
      * @return void
50 50
      */
51
-    public static function printRunTime($force=false)
51
+    public static function printRunTime($force = false)
52 52
     {
53 53
         if ($force === false && self::$printed === true) {
54 54
             // A double call.
Please login to merge, or discard this patch.
src/Util/Cache.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -110,7 +110,7 @@
 block discarded – undo
110 110
             $data    = array(
111 111
                         $code,
112 112
                         $error,
113
-                       );
113
+                        );
114 114
             if (in_array($code, $this->errorCodes) === true) {
115 115
                 $phpcsFile->addErrorOnLine($message, $line, 'ExternalToolError', $data);
116 116
             } else {
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
         $di     = new \RecursiveDirectoryIterator($installDir);
105 105
         $filter = new \RecursiveCallbackFilterIterator(
106 106
             $di,
107
-            function ($file, $key, $iterator) {
107
+            function($file, $key, $iterator) {
108 108
                 // Skip hidden files.
109 109
                 $filename = $file->getFilename();
110 110
                 if (substr($filename, 0, 1) === '.') {
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
      *
277 277
      * @return mixed
278 278
      */
279
-    public static function get($key=null)
279
+    public static function get($key = null)
280 280
     {
281 281
         if ($key === null) {
282 282
             return self::$cache;
Please login to merge, or discard this patch.
src/Util/Tokens.php 1 patch
Indentation   +191 added lines, -191 removed lines patch added patch discarded remove patch
@@ -157,78 +157,78 @@  discard block
 block discarded – undo
157 157
      * @var array<int, int>
158 158
      */
159 159
     public static $weightings = array(
160
-                                 T_CLASS               => 1000,
161
-                                 T_INTERFACE           => 1000,
162
-                                 T_TRAIT               => 1000,
163
-                                 T_NAMESPACE           => 1000,
164
-                                 T_FUNCTION            => 100,
165
-                                 T_CLOSURE             => 100,
166
-
167
-                                 /*
160
+                                    T_CLASS               => 1000,
161
+                                    T_INTERFACE           => 1000,
162
+                                    T_TRAIT               => 1000,
163
+                                    T_NAMESPACE           => 1000,
164
+                                    T_FUNCTION            => 100,
165
+                                    T_CLOSURE             => 100,
166
+
167
+                                    /*
168 168
                                      Conditions.
169 169
                                  */
170 170
 
171
-                                 T_WHILE               => 50,
172
-                                 T_FOR                 => 50,
173
-                                 T_FOREACH             => 50,
174
-                                 T_IF                  => 50,
175
-                                 T_ELSE                => 50,
176
-                                 T_ELSEIF              => 50,
177
-                                 T_DO                  => 50,
178
-                                 T_TRY                 => 50,
179
-                                 T_CATCH               => 50,
180
-                                 T_FINALLY             => 50,
181
-                                 T_SWITCH              => 50,
182
-
183
-                                 T_SELF                => 25,
184
-                                 T_PARENT              => 25,
185
-
186
-                                 /*
171
+                                    T_WHILE               => 50,
172
+                                    T_FOR                 => 50,
173
+                                    T_FOREACH             => 50,
174
+                                    T_IF                  => 50,
175
+                                    T_ELSE                => 50,
176
+                                    T_ELSEIF              => 50,
177
+                                    T_DO                  => 50,
178
+                                    T_TRY                 => 50,
179
+                                    T_CATCH               => 50,
180
+                                    T_FINALLY             => 50,
181
+                                    T_SWITCH              => 50,
182
+
183
+                                    T_SELF                => 25,
184
+                                    T_PARENT              => 25,
185
+
186
+                                    /*
187 187
                                      Operators and arithmetic.
188 188
                                  */
189 189
 
190
-                                 T_BITWISE_AND         => 8,
191
-                                 T_BITWISE_OR          => 8,
192
-                                 T_BITWISE_XOR         => 8,
193
-
194
-                                 T_MULTIPLY            => 5,
195
-                                 T_DIVIDE              => 5,
196
-                                 T_PLUS                => 5,
197
-                                 T_MINUS               => 5,
198
-                                 T_MODULUS             => 5,
199
-                                 T_POW                 => 5,
200
-                                 T_SPACESHIP           => 5,
201
-                                 T_COALESCE            => 5,
202
-
203
-                                 T_SL                  => 5,
204
-                                 T_SR                  => 5,
205
-                                 T_SL_EQUAL            => 5,
206
-                                 T_SR_EQUAL            => 5,
207
-
208
-                                 T_EQUAL               => 5,
209
-                                 T_AND_EQUAL           => 5,
210
-                                 T_CONCAT_EQUAL        => 5,
211
-                                 T_DIV_EQUAL           => 5,
212
-                                 T_MINUS_EQUAL         => 5,
213
-                                 T_MOD_EQUAL           => 5,
214
-                                 T_MUL_EQUAL           => 5,
215
-                                 T_OR_EQUAL            => 5,
216
-                                 T_PLUS_EQUAL          => 5,
217
-                                 T_XOR_EQUAL           => 5,
218
-
219
-                                 T_BOOLEAN_AND         => 5,
220
-                                 T_BOOLEAN_OR          => 5,
221
-
222
-                                 /*
190
+                                    T_BITWISE_AND         => 8,
191
+                                    T_BITWISE_OR          => 8,
192
+                                    T_BITWISE_XOR         => 8,
193
+
194
+                                    T_MULTIPLY            => 5,
195
+                                    T_DIVIDE              => 5,
196
+                                    T_PLUS                => 5,
197
+                                    T_MINUS               => 5,
198
+                                    T_MODULUS             => 5,
199
+                                    T_POW                 => 5,
200
+                                    T_SPACESHIP           => 5,
201
+                                    T_COALESCE            => 5,
202
+
203
+                                    T_SL                  => 5,
204
+                                    T_SR                  => 5,
205
+                                    T_SL_EQUAL            => 5,
206
+                                    T_SR_EQUAL            => 5,
207
+
208
+                                    T_EQUAL               => 5,
209
+                                    T_AND_EQUAL           => 5,
210
+                                    T_CONCAT_EQUAL        => 5,
211
+                                    T_DIV_EQUAL           => 5,
212
+                                    T_MINUS_EQUAL         => 5,
213
+                                    T_MOD_EQUAL           => 5,
214
+                                    T_MUL_EQUAL           => 5,
215
+                                    T_OR_EQUAL            => 5,
216
+                                    T_PLUS_EQUAL          => 5,
217
+                                    T_XOR_EQUAL           => 5,
218
+
219
+                                    T_BOOLEAN_AND         => 5,
220
+                                    T_BOOLEAN_OR          => 5,
221
+
222
+                                    /*
223 223
                                      Equality.
224 224
                                  */
225 225
 
226
-                                 T_IS_EQUAL            => 5,
227
-                                 T_IS_NOT_EQUAL        => 5,
228
-                                 T_IS_IDENTICAL        => 5,
229
-                                 T_IS_NOT_IDENTICAL    => 5,
230
-                                 T_IS_SMALLER_OR_EQUAL => 5,
231
-                                 T_IS_GREATER_OR_EQUAL => 5,
226
+                                    T_IS_EQUAL            => 5,
227
+                                    T_IS_NOT_EQUAL        => 5,
228
+                                    T_IS_IDENTICAL        => 5,
229
+                                    T_IS_NOT_IDENTICAL    => 5,
230
+                                    T_IS_SMALLER_OR_EQUAL => 5,
231
+                                    T_IS_GREATER_OR_EQUAL => 5,
232 232
                                 );
233 233
 
234 234
     /**
@@ -237,21 +237,21 @@  discard block
 block discarded – undo
237 237
      * @var array<int, int>
238 238
      */
239 239
     public static $assignmentTokens = array(
240
-                                       T_EQUAL        => T_EQUAL,
241
-                                       T_AND_EQUAL    => T_AND_EQUAL,
242
-                                       T_OR_EQUAL     => T_OR_EQUAL,
243
-                                       T_CONCAT_EQUAL => T_CONCAT_EQUAL,
244
-                                       T_DIV_EQUAL    => T_DIV_EQUAL,
245
-                                       T_MINUS_EQUAL  => T_MINUS_EQUAL,
246
-                                       T_POW_EQUAL    => T_POW_EQUAL,
247
-                                       T_MOD_EQUAL    => T_MOD_EQUAL,
248
-                                       T_MUL_EQUAL    => T_MUL_EQUAL,
249
-                                       T_PLUS_EQUAL   => T_PLUS_EQUAL,
250
-                                       T_XOR_EQUAL    => T_XOR_EQUAL,
251
-                                       T_DOUBLE_ARROW => T_DOUBLE_ARROW,
252
-                                       T_SL_EQUAL     => T_SL_EQUAL,
253
-                                       T_SR_EQUAL     => T_SR_EQUAL,
254
-                                      );
240
+                                        T_EQUAL        => T_EQUAL,
241
+                                        T_AND_EQUAL    => T_AND_EQUAL,
242
+                                        T_OR_EQUAL     => T_OR_EQUAL,
243
+                                        T_CONCAT_EQUAL => T_CONCAT_EQUAL,
244
+                                        T_DIV_EQUAL    => T_DIV_EQUAL,
245
+                                        T_MINUS_EQUAL  => T_MINUS_EQUAL,
246
+                                        T_POW_EQUAL    => T_POW_EQUAL,
247
+                                        T_MOD_EQUAL    => T_MOD_EQUAL,
248
+                                        T_MUL_EQUAL    => T_MUL_EQUAL,
249
+                                        T_PLUS_EQUAL   => T_PLUS_EQUAL,
250
+                                        T_XOR_EQUAL    => T_XOR_EQUAL,
251
+                                        T_DOUBLE_ARROW => T_DOUBLE_ARROW,
252
+                                        T_SL_EQUAL     => T_SL_EQUAL,
253
+                                        T_SR_EQUAL     => T_SR_EQUAL,
254
+                                        );
255 255
 
256 256
     /**
257 257
      * Tokens that represent equality comparisons.
@@ -259,12 +259,12 @@  discard block
 block discarded – undo
259 259
      * @var array<int, int>
260 260
      */
261 261
     public static $equalityTokens = array(
262
-                                     T_IS_EQUAL            => T_IS_EQUAL,
263
-                                     T_IS_NOT_EQUAL        => T_IS_NOT_EQUAL,
264
-                                     T_IS_IDENTICAL        => T_IS_IDENTICAL,
265
-                                     T_IS_NOT_IDENTICAL    => T_IS_NOT_IDENTICAL,
266
-                                     T_IS_SMALLER_OR_EQUAL => T_IS_SMALLER_OR_EQUAL,
267
-                                     T_IS_GREATER_OR_EQUAL => T_IS_GREATER_OR_EQUAL,
262
+                                        T_IS_EQUAL            => T_IS_EQUAL,
263
+                                        T_IS_NOT_EQUAL        => T_IS_NOT_EQUAL,
264
+                                        T_IS_IDENTICAL        => T_IS_IDENTICAL,
265
+                                        T_IS_NOT_IDENTICAL    => T_IS_NOT_IDENTICAL,
266
+                                        T_IS_SMALLER_OR_EQUAL => T_IS_SMALLER_OR_EQUAL,
267
+                                        T_IS_GREATER_OR_EQUAL => T_IS_GREATER_OR_EQUAL,
268 268
                                     );
269 269
 
270 270
     /**
@@ -273,15 +273,15 @@  discard block
 block discarded – undo
273 273
      * @var array<int, int>
274 274
      */
275 275
     public static $comparisonTokens = array(
276
-                                       T_IS_EQUAL            => T_IS_EQUAL,
277
-                                       T_IS_IDENTICAL        => T_IS_IDENTICAL,
278
-                                       T_IS_NOT_EQUAL        => T_IS_NOT_EQUAL,
279
-                                       T_IS_NOT_IDENTICAL    => T_IS_NOT_IDENTICAL,
280
-                                       T_LESS_THAN           => T_LESS_THAN,
281
-                                       T_GREATER_THAN        => T_GREATER_THAN,
282
-                                       T_IS_SMALLER_OR_EQUAL => T_IS_SMALLER_OR_EQUAL,
283
-                                       T_IS_GREATER_OR_EQUAL => T_IS_GREATER_OR_EQUAL,
284
-                                      );
276
+                                        T_IS_EQUAL            => T_IS_EQUAL,
277
+                                        T_IS_IDENTICAL        => T_IS_IDENTICAL,
278
+                                        T_IS_NOT_EQUAL        => T_IS_NOT_EQUAL,
279
+                                        T_IS_NOT_IDENTICAL    => T_IS_NOT_IDENTICAL,
280
+                                        T_LESS_THAN           => T_LESS_THAN,
281
+                                        T_GREATER_THAN        => T_GREATER_THAN,
282
+                                        T_IS_SMALLER_OR_EQUAL => T_IS_SMALLER_OR_EQUAL,
283
+                                        T_IS_GREATER_OR_EQUAL => T_IS_GREATER_OR_EQUAL,
284
+                                        );
285 285
 
286 286
     /**
287 287
      * Tokens that represent arithmetic operators.
@@ -289,12 +289,12 @@  discard block
 block discarded – undo
289 289
      * @var array<int, int>
290 290
      */
291 291
     public static $arithmeticTokens = array(
292
-                                       T_PLUS     => T_PLUS,
293
-                                       T_MINUS    => T_MINUS,
294
-                                       T_MULTIPLY => T_MULTIPLY,
295
-                                       T_DIVIDE   => T_DIVIDE,
296
-                                       T_MODULUS  => T_MODULUS,
297
-                                      );
292
+                                        T_PLUS     => T_PLUS,
293
+                                        T_MINUS    => T_MINUS,
294
+                                        T_MULTIPLY => T_MULTIPLY,
295
+                                        T_DIVIDE   => T_DIVIDE,
296
+                                        T_MODULUS  => T_MODULUS,
297
+                                        );
298 298
 
299 299
     /**
300 300
      * Tokens that represent casting.
@@ -302,14 +302,14 @@  discard block
 block discarded – undo
302 302
      * @var array<int, int>
303 303
      */
304 304
     public static $castTokens = array(
305
-                                 T_INT_CAST    => T_INT_CAST,
306
-                                 T_STRING_CAST => T_STRING_CAST,
307
-                                 T_DOUBLE_CAST => T_DOUBLE_CAST,
308
-                                 T_ARRAY_CAST  => T_ARRAY_CAST,
309
-                                 T_BOOL_CAST   => T_BOOL_CAST,
310
-                                 T_OBJECT_CAST => T_OBJECT_CAST,
311
-                                 T_UNSET_CAST  => T_UNSET_CAST,
312
-                                 T_BINARY_CAST => T_BINARY_CAST,
305
+                                    T_INT_CAST    => T_INT_CAST,
306
+                                    T_STRING_CAST => T_STRING_CAST,
307
+                                    T_DOUBLE_CAST => T_DOUBLE_CAST,
308
+                                    T_ARRAY_CAST  => T_ARRAY_CAST,
309
+                                    T_BOOL_CAST   => T_BOOL_CAST,
310
+                                    T_OBJECT_CAST => T_OBJECT_CAST,
311
+                                    T_UNSET_CAST  => T_UNSET_CAST,
312
+                                    T_BINARY_CAST => T_BINARY_CAST,
313 313
                                 );
314 314
 
315 315
     /**
@@ -318,17 +318,17 @@  discard block
 block discarded – undo
318 318
      * @var array<int, int>
319 319
      */
320 320
     public static $parenthesisOpeners = array(
321
-                                         T_ARRAY    => T_ARRAY,
322
-                                         T_FUNCTION => T_FUNCTION,
323
-                                         T_CLOSURE  => T_CLOSURE,
324
-                                         T_WHILE    => T_WHILE,
325
-                                         T_FOR      => T_FOR,
326
-                                         T_FOREACH  => T_FOREACH,
327
-                                         T_SWITCH   => T_SWITCH,
328
-                                         T_IF       => T_IF,
329
-                                         T_ELSEIF   => T_ELSEIF,
330
-                                         T_CATCH    => T_CATCH,
331
-                                         T_DECLARE  => T_DECLARE,
321
+                                            T_ARRAY    => T_ARRAY,
322
+                                            T_FUNCTION => T_FUNCTION,
323
+                                            T_CLOSURE  => T_CLOSURE,
324
+                                            T_WHILE    => T_WHILE,
325
+                                            T_FOR      => T_FOR,
326
+                                            T_FOREACH  => T_FOREACH,
327
+                                            T_SWITCH   => T_SWITCH,
328
+                                            T_IF       => T_IF,
329
+                                            T_ELSEIF   => T_ELSEIF,
330
+                                            T_CATCH    => T_CATCH,
331
+                                            T_DECLARE  => T_DECLARE,
332 332
                                         );
333 333
 
334 334
     /**
@@ -337,31 +337,31 @@  discard block
 block discarded – undo
337 337
      * @var array<int, int>
338 338
      */
339 339
     public static $scopeOpeners = array(
340
-                                   T_CLASS      => T_CLASS,
341
-                                   T_ANON_CLASS => T_ANON_CLASS,
342
-                                   T_INTERFACE  => T_INTERFACE,
343
-                                   T_TRAIT      => T_TRAIT,
344
-                                   T_NAMESPACE  => T_NAMESPACE,
345
-                                   T_FUNCTION   => T_FUNCTION,
346
-                                   T_CLOSURE    => T_CLOSURE,
347
-                                   T_IF         => T_IF,
348
-                                   T_SWITCH     => T_SWITCH,
349
-                                   T_CASE       => T_CASE,
350
-                                   T_DECLARE    => T_DECLARE,
351
-                                   T_DEFAULT    => T_DEFAULT,
352
-                                   T_WHILE      => T_WHILE,
353
-                                   T_ELSE       => T_ELSE,
354
-                                   T_ELSEIF     => T_ELSEIF,
355
-                                   T_FOR        => T_FOR,
356
-                                   T_FOREACH    => T_FOREACH,
357
-                                   T_DO         => T_DO,
358
-                                   T_TRY        => T_TRY,
359
-                                   T_CATCH      => T_CATCH,
360
-                                   T_FINALLY    => T_FINALLY,
361
-                                   T_PROPERTY   => T_PROPERTY,
362
-                                   T_OBJECT     => T_OBJECT,
363
-                                   T_USE        => T_USE,
364
-                                  );
340
+                                    T_CLASS      => T_CLASS,
341
+                                    T_ANON_CLASS => T_ANON_CLASS,
342
+                                    T_INTERFACE  => T_INTERFACE,
343
+                                    T_TRAIT      => T_TRAIT,
344
+                                    T_NAMESPACE  => T_NAMESPACE,
345
+                                    T_FUNCTION   => T_FUNCTION,
346
+                                    T_CLOSURE    => T_CLOSURE,
347
+                                    T_IF         => T_IF,
348
+                                    T_SWITCH     => T_SWITCH,
349
+                                    T_CASE       => T_CASE,
350
+                                    T_DECLARE    => T_DECLARE,
351
+                                    T_DEFAULT    => T_DEFAULT,
352
+                                    T_WHILE      => T_WHILE,
353
+                                    T_ELSE       => T_ELSE,
354
+                                    T_ELSEIF     => T_ELSEIF,
355
+                                    T_FOR        => T_FOR,
356
+                                    T_FOREACH    => T_FOREACH,
357
+                                    T_DO         => T_DO,
358
+                                    T_TRY        => T_TRY,
359
+                                    T_CATCH      => T_CATCH,
360
+                                    T_FINALLY    => T_FINALLY,
361
+                                    T_PROPERTY   => T_PROPERTY,
362
+                                    T_OBJECT     => T_OBJECT,
363
+                                    T_USE        => T_USE,
364
+                                    );
365 365
 
366 366
     /**
367 367
      * Tokens that represent scope modifiers.
@@ -369,9 +369,9 @@  discard block
 block discarded – undo
369 369
      * @var array<int, int>
370 370
      */
371 371
     public static $scopeModifiers = array(
372
-                                     T_PRIVATE   => T_PRIVATE,
373
-                                     T_PUBLIC    => T_PUBLIC,
374
-                                     T_PROTECTED => T_PROTECTED,
372
+                                        T_PRIVATE   => T_PRIVATE,
373
+                                        T_PUBLIC    => T_PUBLIC,
374
+                                        T_PROTECTED => T_PROTECTED,
375 375
                                     );
376 376
 
377 377
     /**
@@ -380,12 +380,12 @@  discard block
 block discarded – undo
380 380
      * @var array<int, int>
381 381
      */
382 382
     public static $methodPrefixes = array(
383
-                                     T_PRIVATE   => T_PRIVATE,
384
-                                     T_PUBLIC    => T_PUBLIC,
385
-                                     T_PROTECTED => T_PROTECTED,
386
-                                     T_ABSTRACT  => T_ABSTRACT,
387
-                                     T_STATIC    => T_STATIC,
388
-                                     T_FINAL     => T_FINAL,
383
+                                        T_PRIVATE   => T_PRIVATE,
384
+                                        T_PUBLIC    => T_PUBLIC,
385
+                                        T_PROTECTED => T_PROTECTED,
386
+                                        T_ABSTRACT  => T_ABSTRACT,
387
+                                        T_STATIC    => T_STATIC,
388
+                                        T_FINAL     => T_FINAL,
389 389
                                     );
390 390
 
391 391
     /**
@@ -407,7 +407,7 @@  discard block
 block discarded – undo
407 407
                                 T_BITWISE_XOR => T_BITWISE_XOR,
408 408
                                 T_SL          => T_SL,
409 409
                                 T_SR          => T_SR,
410
-                               );
410
+                                );
411 411
 
412 412
     /**
413 413
      * Tokens that perform boolean operations.
@@ -415,12 +415,12 @@  discard block
 block discarded – undo
415 415
      * @var array<int, int>
416 416
      */
417 417
     public static $booleanOperators = array(
418
-                                       T_BOOLEAN_AND => T_BOOLEAN_AND,
419
-                                       T_BOOLEAN_OR  => T_BOOLEAN_OR,
420
-                                       T_LOGICAL_AND => T_LOGICAL_AND,
421
-                                       T_LOGICAL_OR  => T_LOGICAL_OR,
422
-                                       T_LOGICAL_XOR => T_LOGICAL_XOR,
423
-                                      );
418
+                                        T_BOOLEAN_AND => T_BOOLEAN_AND,
419
+                                        T_BOOLEAN_OR  => T_BOOLEAN_OR,
420
+                                        T_LOGICAL_AND => T_LOGICAL_AND,
421
+                                        T_LOGICAL_OR  => T_LOGICAL_OR,
422
+                                        T_LOGICAL_XOR => T_LOGICAL_XOR,
423
+                                        );
424 424
 
425 425
     /**
426 426
      * Tokens that open code blocks.
@@ -428,11 +428,11 @@  discard block
 block discarded – undo
428 428
      * @var array<int, int>
429 429
      */
430 430
     public static $blockOpeners = array(
431
-                                   T_OPEN_CURLY_BRACKET  => T_OPEN_CURLY_BRACKET,
432
-                                   T_OPEN_SQUARE_BRACKET => T_OPEN_SQUARE_BRACKET,
433
-                                   T_OPEN_PARENTHESIS    => T_OPEN_PARENTHESIS,
434
-                                   T_OBJECT              => T_OBJECT,
435
-                                  );
431
+                                    T_OPEN_CURLY_BRACKET  => T_OPEN_CURLY_BRACKET,
432
+                                    T_OPEN_SQUARE_BRACKET => T_OPEN_SQUARE_BRACKET,
433
+                                    T_OPEN_PARENTHESIS    => T_OPEN_PARENTHESIS,
434
+                                    T_OBJECT              => T_OBJECT,
435
+                                    );
436 436
 
437 437
     /**
438 438
      * Tokens that don't represent code.
@@ -440,16 +440,16 @@  discard block
 block discarded – undo
440 440
      * @var array<int, int>
441 441
      */
442 442
     public static $emptyTokens = array(
443
-                                  T_WHITESPACE             => T_WHITESPACE,
444
-                                  T_COMMENT                => T_COMMENT,
445
-                                  T_DOC_COMMENT            => T_DOC_COMMENT,
446
-                                  T_DOC_COMMENT_STAR       => T_DOC_COMMENT_STAR,
447
-                                  T_DOC_COMMENT_WHITESPACE => T_DOC_COMMENT_WHITESPACE,
448
-                                  T_DOC_COMMENT_TAG        => T_DOC_COMMENT_TAG,
449
-                                  T_DOC_COMMENT_OPEN_TAG   => T_DOC_COMMENT_OPEN_TAG,
450
-                                  T_DOC_COMMENT_CLOSE_TAG  => T_DOC_COMMENT_CLOSE_TAG,
451
-                                  T_DOC_COMMENT_STRING     => T_DOC_COMMENT_STRING,
452
-                                 );
443
+                                    T_WHITESPACE             => T_WHITESPACE,
444
+                                    T_COMMENT                => T_COMMENT,
445
+                                    T_DOC_COMMENT            => T_DOC_COMMENT,
446
+                                    T_DOC_COMMENT_STAR       => T_DOC_COMMENT_STAR,
447
+                                    T_DOC_COMMENT_WHITESPACE => T_DOC_COMMENT_WHITESPACE,
448
+                                    T_DOC_COMMENT_TAG        => T_DOC_COMMENT_TAG,
449
+                                    T_DOC_COMMENT_OPEN_TAG   => T_DOC_COMMENT_OPEN_TAG,
450
+                                    T_DOC_COMMENT_CLOSE_TAG  => T_DOC_COMMENT_CLOSE_TAG,
451
+                                    T_DOC_COMMENT_STRING     => T_DOC_COMMENT_STRING,
452
+                                    );
453 453
 
454 454
     /**
455 455
      * Tokens that are comments.
@@ -465,7 +465,7 @@  discard block
 block discarded – undo
465 465
                                     T_DOC_COMMENT_OPEN_TAG   => T_DOC_COMMENT_OPEN_TAG,
466 466
                                     T_DOC_COMMENT_CLOSE_TAG  => T_DOC_COMMENT_CLOSE_TAG,
467 467
                                     T_DOC_COMMENT_STRING     => T_DOC_COMMENT_STRING,
468
-                                   );
468
+                                    );
469 469
 
470 470
     /**
471 471
      * Tokens that represent strings.
@@ -475,9 +475,9 @@  discard block
 block discarded – undo
475 475
      * @var array<int, int>
476 476
      */
477 477
     public static $stringTokens = array(
478
-                                   T_CONSTANT_ENCAPSED_STRING => T_CONSTANT_ENCAPSED_STRING,
479
-                                   T_DOUBLE_QUOTED_STRING     => T_DOUBLE_QUOTED_STRING,
480
-                                  );
478
+                                    T_CONSTANT_ENCAPSED_STRING => T_CONSTANT_ENCAPSED_STRING,
479
+                                    T_DOUBLE_QUOTED_STRING     => T_DOUBLE_QUOTED_STRING,
480
+                                    );
481 481
 
482 482
     /**
483 483
      * Tokens that represent brackets and parenthesis.
@@ -491,7 +491,7 @@  discard block
 block discarded – undo
491 491
                                     T_CLOSE_SQUARE_BRACKET => T_CLOSE_SQUARE_BRACKET,
492 492
                                     T_OPEN_PARENTHESIS     => T_OPEN_PARENTHESIS,
493 493
                                     T_CLOSE_PARENTHESIS    => T_CLOSE_PARENTHESIS,
494
-                                   );
494
+                                    );
495 495
 
496 496
     /**
497 497
      * Tokens that include files.
@@ -503,7 +503,7 @@  discard block
 block discarded – undo
503 503
                                     T_REQUIRE      => T_REQUIRE,
504 504
                                     T_INCLUDE_ONCE => T_INCLUDE_ONCE,
505 505
                                     T_INCLUDE      => T_INCLUDE,
506
-                                   );
506
+                                    );
507 507
 
508 508
     /**
509 509
      * Tokens that make up a heredoc string.
@@ -517,7 +517,7 @@  discard block
 block discarded – undo
517 517
                                     T_START_NOWDOC  => T_START_NOWDOC,
518 518
                                     T_END_NOWDOC    => T_END_NOWDOC,
519 519
                                     T_NOWDOC        => T_NOWDOC,
520
-                                   );
520
+                                    );
521 521
 
522 522
     /**
523 523
      * Tokens that represent the names of called functions.
@@ -528,16 +528,16 @@  discard block
 block discarded – undo
528 528
      * @var array<int, int>
529 529
      */
530 530
     public static $functionNameTokens = array(
531
-                                         T_STRING       => T_STRING,
532
-                                         T_EVAL         => T_EVAL,
533
-                                         T_EXIT         => T_EXIT,
534
-                                         T_INCLUDE      => T_INCLUDE,
535
-                                         T_INCLUDE_ONCE => T_INCLUDE_ONCE,
536
-                                         T_REQUIRE      => T_REQUIRE,
537
-                                         T_REQUIRE_ONCE => T_REQUIRE_ONCE,
538
-                                         T_ISSET        => T_ISSET,
539
-                                         T_UNSET        => T_UNSET,
540
-                                         T_EMPTY        => T_EMPTY,
531
+                                            T_STRING       => T_STRING,
532
+                                            T_EVAL         => T_EVAL,
533
+                                            T_EXIT         => T_EXIT,
534
+                                            T_INCLUDE      => T_INCLUDE,
535
+                                            T_INCLUDE_ONCE => T_INCLUDE_ONCE,
536
+                                            T_REQUIRE      => T_REQUIRE,
537
+                                            T_REQUIRE_ONCE => T_REQUIRE_ONCE,
538
+                                            T_ISSET        => T_ISSET,
539
+                                            T_UNSET        => T_UNSET,
540
+                                            T_EMPTY        => T_EMPTY,
541 541
                                         );
542 542
 
543 543
 
Please login to merge, or discard this patch.
src/Util/Standards.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -60,8 +60,8 @@
 block discarded – undo
60 60
      * @see    isInstalledStandard()
61 61
      */
62 62
     public static function getInstalledStandards(
63
-        $includeGeneric=false,
64
-        $standardsDir=''
63
+        $includeGeneric = false,
64
+        $standardsDir = ''
65 65
     ) {
66 66
         $installedStandards = array();
67 67
 
Please login to merge, or discard this patch.
src/Filters/Filter.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -212,8 +212,8 @@
 block discarded – undo
212 212
             }
213 213
 
214 214
             $replacements = array(
215
-                             '\\,' => ',',
216
-                             '*'   => '.*',
215
+                                '\\,' => ',',
216
+                                '*'   => '.*',
217 217
                             );
218 218
 
219 219
             // We assume a / directory separator, as do the exclude rules
Please login to merge, or discard this patch.
src/Reporter.php 1 patch
Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -116,8 +116,8 @@  discard block
 block discarded – undo
116 116
             }
117 117
 
118 118
             $this->reports[$type] = array(
119
-                                     'output' => $output,
120
-                                     'class'  => $reportClass,
119
+                                        'output' => $output,
120
+                                        'class'  => $reportClass,
121 121
                                     );
122 122
 
123 123
             if ($output === null) {
@@ -285,12 +285,12 @@  discard block
 block discarded – undo
285 285
     public function prepareFileReport(File $phpcsFile)
286 286
     {
287 287
         $report = array(
288
-                   'filename' => Common::stripBasepath($phpcsFile->getFilename(), $this->config->basepath),
289
-                   'errors'   => $phpcsFile->getErrorCount(),
290
-                   'warnings' => $phpcsFile->getWarningCount(),
291
-                   'fixable'  => $phpcsFile->getFixableCount(),
292
-                   'messages' => array(),
293
-                  );
288
+                    'filename' => Common::stripBasepath($phpcsFile->getFilename(), $this->config->basepath),
289
+                    'errors'   => $phpcsFile->getErrorCount(),
290
+                    'warnings' => $phpcsFile->getWarningCount(),
291
+                    'fixable'  => $phpcsFile->getFixableCount(),
292
+                    'messages' => array(),
293
+                    );
294 294
 
295 295
         if ($report['errors'] === 0 && $report['warnings'] === 0) {
296 296
             // Prefect score!
@@ -301,13 +301,13 @@  discard block
 block discarded – undo
301 301
             $message  = 'Errors are not being recorded but this report requires error messages. ';
302 302
             $message .= 'This report will not show the correct information.';
303 303
             $report['messages'][1][1] = array(
304
-                                         array(
305
-                                          'message'  => $message,
306
-                                          'source'   => 'Internal.RecordErrors',
307
-                                          'severity' => 5,
308
-                                          'fixable'  => false,
309
-                                          'type'     => 'ERROR',
310
-                                         ),
304
+                                            array(
305
+                                            'message'  => $message,
306
+                                            'source'   => 'Internal.RecordErrors',
307
+                                            'severity' => 5,
308
+                                            'fixable'  => false,
309
+                                            'type'     => 'ERROR',
310
+                                            ),
311 311
                                         );
312 312
             return $report;
313 313
         }
@@ -325,7 +325,7 @@  discard block
 block discarded – undo
325 325
                                     'severity' => $data['severity'],
326 326
                                     'fixable'  => $data['fixable'],
327 327
                                     'type'     => 'ERROR',
328
-                                   );
328
+                                    );
329 329
                 }
330 330
 
331 331
                 $errors[$line][$column] = $newErrors;
@@ -339,12 +339,12 @@  discard block
 block discarded – undo
339 339
                 $newWarnings = array();
340 340
                 foreach ($colWarnings as $data) {
341 341
                     $newWarnings[] = array(
342
-                                      'message'  => $data['message'],
343
-                                      'source'   => $data['source'],
344
-                                      'severity' => $data['severity'],
345
-                                      'fixable'  => $data['fixable'],
346
-                                      'type'     => 'WARNING',
347
-                                     );
342
+                                        'message'  => $data['message'],
343
+                                        'source'   => $data['source'],
344
+                                        'severity' => $data['severity'],
345
+                                        'fixable'  => $data['fixable'],
346
+                                        'type'     => 'WARNING',
347
+                                        );
348 348
                 }
349 349
 
350 350
                 if (isset($errors[$line]) === false) {
Please login to merge, or discard this patch.
src/Config.php 3 patches
Indentation   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -90,37 +90,37 @@  discard block
 block discarded – undo
90 90
      * @var array<string, mixed>
91 91
      */
92 92
     private $settings = array(
93
-                         'files'           => null,
94
-                         'standards'       => null,
95
-                         'verbosity'       => null,
96
-                         'interactive'     => null,
97
-                         'parallel'        => null,
98
-                         'cache'           => null,
99
-                         'cacheFile'       => null,
100
-                         'colors'          => null,
101
-                         'explain'         => null,
102
-                         'local'           => null,
103
-                         'showSources'     => null,
104
-                         'showProgress'    => null,
105
-                         'tabWidth'        => null,
106
-                         'encoding'        => null,
107
-                         'extensions'      => null,
108
-                         'sniffs'          => null,
109
-                         'ignored'         => null,
110
-                         'reportFile'      => null,
111
-                         'generator'       => null,
112
-                         'filter'          => null,
113
-                         'bootstrap'       => null,
114
-                         'reports'         => null,
115
-                         'basepath'        => null,
116
-                         'reportWidth'     => null,
117
-                         'errorSeverity'   => null,
118
-                         'warningSeverity' => null,
119
-                         'recordErrors'    => null,
120
-                         'suffix'          => null,
121
-                         'stdin'           => null,
122
-                         'stdinContent'    => null,
123
-                         'stdinPath'       => null,
93
+                            'files'           => null,
94
+                            'standards'       => null,
95
+                            'verbosity'       => null,
96
+                            'interactive'     => null,
97
+                            'parallel'        => null,
98
+                            'cache'           => null,
99
+                            'cacheFile'       => null,
100
+                            'colors'          => null,
101
+                            'explain'         => null,
102
+                            'local'           => null,
103
+                            'showSources'     => null,
104
+                            'showProgress'    => null,
105
+                            'tabWidth'        => null,
106
+                            'encoding'        => null,
107
+                            'extensions'      => null,
108
+                            'sniffs'          => null,
109
+                            'ignored'         => null,
110
+                            'reportFile'      => null,
111
+                            'generator'       => null,
112
+                            'filter'          => null,
113
+                            'bootstrap'       => null,
114
+                            'reports'         => null,
115
+                            'basepath'        => null,
116
+                            'reportWidth'     => null,
117
+                            'errorSeverity'   => null,
118
+                            'warningSeverity' => null,
119
+                            'recordErrors'    => null,
120
+                            'suffix'          => null,
121
+                            'stdin'           => null,
122
+                            'stdinContent'    => null,
123
+                            'stdinPath'       => null,
124 124
                         );
125 125
 
126 126
     /**
@@ -417,11 +417,11 @@  discard block
 block discarded – undo
417 417
         $this->tabWidth        = 0;
418 418
         $this->encoding        = 'utf-8';
419 419
         $this->extensions      = array(
420
-                                  'php' => 'PHP',
421
-                                  'inc' => 'PHP',
422
-                                  'js'  => 'JS',
423
-                                  'css' => 'CSS',
424
-                                 );
420
+                                    'php' => 'PHP',
421
+                                    'inc' => 'PHP',
422
+                                    'js'  => 'JS',
423
+                                    'css' => 'CSS',
424
+                                    );
425 425
         $this->sniffs          = array();
426 426
         $this->ignored         = array();
427 427
         $this->reportFile      = null;
Please login to merge, or discard this patch.
Switch Indentation   +402 added lines, -402 removed lines patch added patch discarded remove patch
@@ -204,35 +204,35 @@  discard block
 block discarded – undo
204 204
         }
205 205
 
206 206
         switch ($name) {
207
-        case 'reportWidth' :
208
-            // Support auto terminal width.
209
-            if ($value === 'auto' && preg_match('|\d+ (\d+)|', shell_exec('stty size 2>&1'), $matches) === 1) {
210
-                $value = (int) $matches[1];
211
-            } else {
212
-                $value = (int) $value;
213
-            }
214
-            break;
215
-        case 'standards' :
216
-            $cleaned = array();
217
-
218
-            // Check if the standard name is valid, or if the case is invalid.
219
-            $installedStandards = Util\Standards::getInstalledStandards();
220
-            foreach ($value as $standard) {
221
-                foreach ($installedStandards as $validStandard) {
222
-                    if (strtolower($standard) === strtolower($validStandard)) {
223
-                        $standard = $validStandard;
224
-                        break;
225
-                    }
207
+            case 'reportWidth' :
208
+                // Support auto terminal width.
209
+                if ($value === 'auto' && preg_match('|\d+ (\d+)|', shell_exec('stty size 2>&1'), $matches) === 1) {
210
+                    $value = (int) $matches[1];
211
+                } else {
212
+                    $value = (int) $value;
226 213
                 }
214
+                break;
215
+            case 'standards' :
216
+                $cleaned = array();
217
+
218
+                // Check if the standard name is valid, or if the case is invalid.
219
+                $installedStandards = Util\Standards::getInstalledStandards();
220
+                foreach ($value as $standard) {
221
+                    foreach ($installedStandards as $validStandard) {
222
+                        if (strtolower($standard) === strtolower($validStandard)) {
223
+                            $standard = $validStandard;
224
+                            break;
225
+                        }
226
+                    }
227 227
 
228
-                $cleaned[] = $standard;
229
-            }
228
+                    $cleaned[] = $standard;
229
+                }
230 230
 
231
-            $value = $cleaned;
232
-            break;
233
-        default :
234
-            // No validation required.
235
-            break;
231
+                $value = $cleaned;
232
+                break;
233
+            default :
234
+                // No validation required.
235
+                break;
236 236
         }//end switch
237 237
 
238 238
         $this->settings[$name] = $value;
@@ -523,68 +523,68 @@  discard block
 block discarded – undo
523 523
     public function processShortArgument($arg, $pos)
524 524
     {
525 525
         switch ($arg) {
526
-        case 'h':
527
-        case '?':
528
-            $this->printUsage();
529
-            exit(0);
530
-        case 'i' :
531
-            Util\Standards::printInstalledStandards();
532
-            exit(0);
533
-        case 'v' :
534
-            $this->verbosity++;
535
-            $this->overriddenDefaults['verbosity'] = true;
536
-            break;
537
-        case 'l' :
538
-            $this->local = true;
539
-            $this->overriddenDefaults['local'] = true;
540
-            break;
541
-        case 's' :
542
-            $this->showSources = true;
543
-            $this->overriddenDefaults['showSources'] = true;
544
-            break;
545
-        case 'a' :
546
-            $this->interactive = true;
547
-            $this->overriddenDefaults['interactive'] = true;
548
-            break;
549
-        case 'e':
550
-            $this->explain = true;
551
-            $this->overriddenDefaults['explain'] = true;
552
-            break;
553
-        case 'p' :
554
-            $this->showProgress = true;
555
-            $this->overriddenDefaults['showProgress'] = true;
556
-            break;
557
-        case 'm' :
558
-            $this->recordErrors = false;
559
-            $this->overriddenDefaults['recordErrors'] = true;
560
-            break;
561
-        case 'd' :
562
-            $ini = explode('=', $this->cliArgs[($pos + 1)]);
563
-            $this->cliArgs[($pos + 1)] = '';
564
-            if (isset($ini[1]) === true) {
565
-                ini_set($ini[0], $ini[1]);
566
-            } else {
567
-                ini_set($ini[0], true);
568
-            }
569
-            break;
570
-        case 'n' :
571
-            if (isset($this->overriddenDefaults['warningSeverity']) === false) {
572
-                $this->warningSeverity = 0;
573
-                $this->overriddenDefaults['warningSeverity'] = true;
574
-            }
575
-            break;
576
-        case 'w' :
577
-            if (isset($this->overriddenDefaults['warningSeverity']) === false) {
578
-                $this->warningSeverity = $this->errorSeverity;
579
-                $this->overriddenDefaults['warningSeverity'] = true;
580
-            }
581
-            break;
582
-        default:
583
-            if ($this->dieOnUnknownArg === false) {
584
-                $this->values[$arg] = $arg;
585
-            } else {
586
-                $this->processUnknownArgument('-'.$arg, $pos);
587
-            }
526
+            case 'h':
527
+            case '?':
528
+                $this->printUsage();
529
+                exit(0);
530
+            case 'i' :
531
+                Util\Standards::printInstalledStandards();
532
+                exit(0);
533
+            case 'v' :
534
+                $this->verbosity++;
535
+                $this->overriddenDefaults['verbosity'] = true;
536
+                break;
537
+            case 'l' :
538
+                $this->local = true;
539
+                $this->overriddenDefaults['local'] = true;
540
+                break;
541
+            case 's' :
542
+                $this->showSources = true;
543
+                $this->overriddenDefaults['showSources'] = true;
544
+                break;
545
+            case 'a' :
546
+                $this->interactive = true;
547
+                $this->overriddenDefaults['interactive'] = true;
548
+                break;
549
+            case 'e':
550
+                $this->explain = true;
551
+                $this->overriddenDefaults['explain'] = true;
552
+                break;
553
+            case 'p' :
554
+                $this->showProgress = true;
555
+                $this->overriddenDefaults['showProgress'] = true;
556
+                break;
557
+            case 'm' :
558
+                $this->recordErrors = false;
559
+                $this->overriddenDefaults['recordErrors'] = true;
560
+                break;
561
+            case 'd' :
562
+                $ini = explode('=', $this->cliArgs[($pos + 1)]);
563
+                $this->cliArgs[($pos + 1)] = '';
564
+                if (isset($ini[1]) === true) {
565
+                    ini_set($ini[0], $ini[1]);
566
+                } else {
567
+                    ini_set($ini[0], true);
568
+                }
569
+                break;
570
+            case 'n' :
571
+                if (isset($this->overriddenDefaults['warningSeverity']) === false) {
572
+                    $this->warningSeverity = 0;
573
+                    $this->overriddenDefaults['warningSeverity'] = true;
574
+                }
575
+                break;
576
+            case 'w' :
577
+                if (isset($this->overriddenDefaults['warningSeverity']) === false) {
578
+                    $this->warningSeverity = $this->errorSeverity;
579
+                    $this->overriddenDefaults['warningSeverity'] = true;
580
+                }
581
+                break;
582
+            default:
583
+                if ($this->dieOnUnknownArg === false) {
584
+                    $this->values[$arg] = $arg;
585
+                } else {
586
+                    $this->processUnknownArgument('-'.$arg, $pos);
587
+                }
588 588
         }//end switch
589 589
 
590 590
     }//end processShortArgument()
@@ -601,383 +601,383 @@  discard block
 block discarded – undo
601 601
     public function processLongArgument($arg, $pos)
602 602
     {
603 603
         switch ($arg) {
604
-        case 'help':
605
-            $this->printUsage();
606
-            exit(0);
607
-        case 'version':
608
-            echo 'PHP_CodeSniffer version '.self::VERSION.' ('.self::STABILITY.') ';
609
-            echo 'by Squiz (http://www.squiz.net)'.PHP_EOL;
610
-            exit(0);
611
-        case 'colors':
612
-            $this->colors = true;
613
-            $this->overriddenDefaults['colors'] = true;
614
-            break;
615
-        case 'no-colors':
616
-            $this->colors = false;
617
-            $this->overriddenDefaults['colors'] = true;
618
-            break;
619
-        case 'cache':
620
-            if (defined('PHP_CODESNIFFER_IN_TESTS') === false) {
621
-                $this->cache = true;
622
-                $this->overriddenDefaults['cache'] = true;
623
-            }
624
-            break;
625
-        case 'no-cache':
626
-            $this->cache = false;
627
-            $this->overriddenDefaults['cache'] = true;
628
-            break;
629
-        case 'config-set':
630
-            if (isset($this->cliArgs[($pos + 1)]) === false
631
-                || isset($this->cliArgs[($pos + 2)]) === false
632
-            ) {
633
-                echo 'ERROR: Setting a config option requires a name and value'.PHP_EOL.PHP_EOL;
604
+            case 'help':
634 605
                 $this->printUsage();
635 606
                 exit(0);
636
-            }
637
-
638
-            $key     = $this->cliArgs[($pos + 1)];
639
-            $value   = $this->cliArgs[($pos + 2)];
640
-            $current = self::getConfigData($key);
641
-
642
-            try {
643
-                $this->setConfigData($key, $value);
644
-            } catch (Exception $e) {
645
-                echo $e->getMessage().PHP_EOL;
646
-                exit(2);
647
-            }
648
-
649
-            if ($current === null) {
650
-                echo "Config value \"$key\" added successfully".PHP_EOL;
651
-            } else {
652
-                echo "Config value \"$key\" updated successfully; old value was \"$current\"".PHP_EOL;
653
-            }
654
-            exit(0);
655
-        case 'config-delete':
656
-            if (isset($this->cliArgs[($pos + 1)]) === false) {
657
-                echo 'ERROR: Deleting a config option requires the name of the option'.PHP_EOL.PHP_EOL;
658
-                $this->printUsage();
607
+            case 'version':
608
+                echo 'PHP_CodeSniffer version '.self::VERSION.' ('.self::STABILITY.') ';
609
+                echo 'by Squiz (http://www.squiz.net)'.PHP_EOL;
659 610
                 exit(0);
660
-            }
611
+            case 'colors':
612
+                $this->colors = true;
613
+                $this->overriddenDefaults['colors'] = true;
614
+                break;
615
+            case 'no-colors':
616
+                $this->colors = false;
617
+                $this->overriddenDefaults['colors'] = true;
618
+                break;
619
+            case 'cache':
620
+                if (defined('PHP_CODESNIFFER_IN_TESTS') === false) {
621
+                    $this->cache = true;
622
+                    $this->overriddenDefaults['cache'] = true;
623
+                }
624
+                break;
625
+            case 'no-cache':
626
+                $this->cache = false;
627
+                $this->overriddenDefaults['cache'] = true;
628
+                break;
629
+            case 'config-set':
630
+                if (isset($this->cliArgs[($pos + 1)]) === false
631
+                    || isset($this->cliArgs[($pos + 2)]) === false
632
+                ) {
633
+                    echo 'ERROR: Setting a config option requires a name and value'.PHP_EOL.PHP_EOL;
634
+                    $this->printUsage();
635
+                    exit(0);
636
+                }
637
+
638
+                $key     = $this->cliArgs[($pos + 1)];
639
+                $value   = $this->cliArgs[($pos + 2)];
640
+                $current = self::getConfigData($key);
661 641
 
662
-            $key     = $this->cliArgs[($pos + 1)];
663
-            $current = self::getConfigData($key);
664
-            if ($current === null) {
665
-                echo "Config value \"$key\" has not been set".PHP_EOL;
666
-            } else {
667 642
                 try {
668
-                    $this->setConfigData($key, null);
643
+                    $this->setConfigData($key, $value);
669 644
                 } catch (Exception $e) {
670 645
                     echo $e->getMessage().PHP_EOL;
671 646
                     exit(2);
672 647
                 }
673 648
 
674
-                echo "Config value \"$key\" removed successfully; old value was \"$current\"".PHP_EOL;
675
-            }
676
-            exit(0);
677
-        case 'config-show':
678
-            $data = self::getAllConfigData();
679
-            $this->printConfigData($data);
680
-            exit(0);
681
-        case 'runtime-set':
682
-            if (isset($this->cliArgs[($pos + 1)]) === false
683
-                || isset($this->cliArgs[($pos + 2)]) === false
684
-            ) {
685
-                echo 'ERROR: Setting a runtime config option requires a name and value'.PHP_EOL.PHP_EOL;
686
-                $this->printUsage();
649
+                if ($current === null) {
650
+                    echo "Config value \"$key\" added successfully".PHP_EOL;
651
+                } else {
652
+                    echo "Config value \"$key\" updated successfully; old value was \"$current\"".PHP_EOL;
653
+                }
687 654
                 exit(0);
688
-            }
655
+            case 'config-delete':
656
+                if (isset($this->cliArgs[($pos + 1)]) === false) {
657
+                    echo 'ERROR: Deleting a config option requires the name of the option'.PHP_EOL.PHP_EOL;
658
+                    $this->printUsage();
659
+                    exit(0);
660
+                }
689 661
 
690
-            $key   = $this->cliArgs[($pos + 1)];
691
-            $value = $this->cliArgs[($pos + 2)];
692
-            $this->cliArgs[($pos + 1)] = '';
693
-            $this->cliArgs[($pos + 2)] = '';
694
-            self::setConfigData($key, $value, true);
695
-            break;
696
-        default:
697
-            if (substr($arg, 0, 7) === 'sniffs=') {
698
-                $sniffs = explode(',', substr($arg, 7));
699
-                foreach ($sniffs as $sniff) {
700
-                    if (substr_count($sniff, '.') !== 2) {
701
-                        echo 'ERROR: The specified sniff code "'.$sniff.'" is invalid'.PHP_EOL.PHP_EOL;
702
-                        $this->printUsage();
662
+                $key     = $this->cliArgs[($pos + 1)];
663
+                $current = self::getConfigData($key);
664
+                if ($current === null) {
665
+                    echo "Config value \"$key\" has not been set".PHP_EOL;
666
+                } else {
667
+                    try {
668
+                        $this->setConfigData($key, null);
669
+                    } catch (Exception $e) {
670
+                        echo $e->getMessage().PHP_EOL;
703 671
                         exit(2);
704 672
                     }
673
+
674
+                    echo "Config value \"$key\" removed successfully; old value was \"$current\"".PHP_EOL;
675
+                }
676
+                exit(0);
677
+            case 'config-show':
678
+                $data = self::getAllConfigData();
679
+                $this->printConfigData($data);
680
+                exit(0);
681
+            case 'runtime-set':
682
+                if (isset($this->cliArgs[($pos + 1)]) === false
683
+                    || isset($this->cliArgs[($pos + 2)]) === false
684
+                ) {
685
+                    echo 'ERROR: Setting a runtime config option requires a name and value'.PHP_EOL.PHP_EOL;
686
+                    $this->printUsage();
687
+                    exit(0);
705 688
                 }
706 689
 
707
-                $this->sniffs = $sniffs;
708
-                $this->overriddenDefaults['sniffs'] = true;
709
-            } else if (defined('PHP_CODESNIFFER_IN_TESTS') === false
710
-                && substr($arg, 0, 6) === 'cache='
711
-            ) {
712
-                // Turn caching on.
713
-                $this->cache = true;
714
-                $this->overriddenDefaults['cache'] = true;
690
+                $key   = $this->cliArgs[($pos + 1)];
691
+                $value = $this->cliArgs[($pos + 2)];
692
+                $this->cliArgs[($pos + 1)] = '';
693
+                $this->cliArgs[($pos + 2)] = '';
694
+                self::setConfigData($key, $value, true);
695
+                break;
696
+            default:
697
+                if (substr($arg, 0, 7) === 'sniffs=') {
698
+                    $sniffs = explode(',', substr($arg, 7));
699
+                    foreach ($sniffs as $sniff) {
700
+                        if (substr_count($sniff, '.') !== 2) {
701
+                            echo 'ERROR: The specified sniff code "'.$sniff.'" is invalid'.PHP_EOL.PHP_EOL;
702
+                            $this->printUsage();
703
+                            exit(2);
704
+                        }
705
+                    }
715 706
 
716
-                $this->cacheFile = Util\Common::realpath(substr($arg, 6));
707
+                    $this->sniffs = $sniffs;
708
+                    $this->overriddenDefaults['sniffs'] = true;
709
+                } else if (defined('PHP_CODESNIFFER_IN_TESTS') === false
710
+                    && substr($arg, 0, 6) === 'cache='
711
+                ) {
712
+                    // Turn caching on.
713
+                    $this->cache = true;
714
+                    $this->overriddenDefaults['cache'] = true;
715
+
716
+                    $this->cacheFile = Util\Common::realpath(substr($arg, 6));
717
+
718
+                    // It may not exist and return false instead.
719
+                    if ($this->cacheFile === false) {
720
+                        $this->cacheFile = substr($arg, 6);
721
+
722
+                        $dir = dirname($this->cacheFile);
723
+                        if (is_dir($dir) === false) {
724
+                            echo 'ERROR: The specified cache file path "'.$this->cacheFile.'" points to a non-existent directory'.PHP_EOL.PHP_EOL;
725
+                            $this->printUsage();
726
+                            exit(2);
727
+                        }
717 728
 
718
-                // It may not exist and return false instead.
719
-                if ($this->cacheFile === false) {
720
-                    $this->cacheFile = substr($arg, 6);
729
+                        if ($dir === '.') {
730
+                            // Passed report file is a file in the current directory.
731
+                            $this->cacheFile = getcwd().'/'.basename($this->cacheFile);
732
+                        } else {
733
+                            $dir = Util\Common::realpath(getcwd().'/'.$dir);
734
+                            if ($dir !== false) {
735
+                                // Report file path is relative.
736
+                                $this->cacheFile = $dir.'/'.basename($this->cacheFile);
737
+                            }
738
+                        }
739
+                    }//end if
721 740
 
722
-                    $dir = dirname($this->cacheFile);
723
-                    if (is_dir($dir) === false) {
724
-                        echo 'ERROR: The specified cache file path "'.$this->cacheFile.'" points to a non-existent directory'.PHP_EOL.PHP_EOL;
741
+                    $this->overriddenDefaults['cacheFile'] = true;
742
+
743
+                    if (is_dir($this->cacheFile) === true) {
744
+                        echo 'ERROR: The specified cache file path "'.$this->cacheFile.'" is a directory'.PHP_EOL.PHP_EOL;
725 745
                         $this->printUsage();
726 746
                         exit(2);
727 747
                     }
728
-
729
-                    if ($dir === '.') {
730
-                        // Passed report file is a file in the current directory.
731
-                        $this->cacheFile = getcwd().'/'.basename($this->cacheFile);
732
-                    } else {
733
-                        $dir = Util\Common::realpath(getcwd().'/'.$dir);
734
-                        if ($dir !== false) {
735
-                            // Report file path is relative.
736
-                            $this->cacheFile = $dir.'/'.basename($this->cacheFile);
748
+                } else if (substr($arg, 0, 10) === 'bootstrap=') {
749
+                    $files     = explode(',', substr($arg, 10));
750
+                    $bootstrap = array();
751
+                    foreach ($files as $file) {
752
+                        $path = Util\Common::realpath($file);
753
+                        if ($path === false) {
754
+                            echo 'ERROR: The specified bootstrap file "'.$file.'" does not exist'.PHP_EOL.PHP_EOL;
755
+                            $this->printUsage();
756
+                            exit(2);
737 757
                         }
758
+
759
+                        $bootstrap[] = $path;
738 760
                     }
739
-                }//end if
740 761
 
741
-                $this->overriddenDefaults['cacheFile'] = true;
762
+                    $this->bootstrap = array_merge($this->bootstrap, $bootstrap);
763
+                    $this->overriddenDefaults['bootstrap'] = true;
764
+                } else if (substr($arg, 0, 11) === 'stdin-path=') {
765
+                    $this->stdinPath = Util\Common::realpath(substr($arg, 11));
742 766
 
743
-                if (is_dir($this->cacheFile) === true) {
744
-                    echo 'ERROR: The specified cache file path "'.$this->cacheFile.'" is a directory'.PHP_EOL.PHP_EOL;
745
-                    $this->printUsage();
746
-                    exit(2);
747
-                }
748
-            } else if (substr($arg, 0, 10) === 'bootstrap=') {
749
-                $files     = explode(',', substr($arg, 10));
750
-                $bootstrap = array();
751
-                foreach ($files as $file) {
752
-                    $path = Util\Common::realpath($file);
753
-                    if ($path === false) {
754
-                        echo 'ERROR: The specified bootstrap file "'.$file.'" does not exist'.PHP_EOL.PHP_EOL;
755
-                        $this->printUsage();
756
-                        exit(2);
767
+                    // It may not exist and return false instead, so use whatever they gave us.
768
+                    if ($this->stdinPath === false) {
769
+                        $this->stdinPath = trim(substr($arg, 11));
757 770
                     }
758 771
 
759
-                    $bootstrap[] = $path;
760
-                }
772
+                    $this->overriddenDefaults['stdinPath'] = true;
773
+                } else if (PHP_CODESNIFFER_CBF === false && substr($arg, 0, 12) === 'report-file=') {
774
+                    $this->reportFile = Util\Common::realpath(substr($arg, 12));
761 775
 
762
-                $this->bootstrap = array_merge($this->bootstrap, $bootstrap);
763
-                $this->overriddenDefaults['bootstrap'] = true;
764
-            } else if (substr($arg, 0, 11) === 'stdin-path=') {
765
-                $this->stdinPath = Util\Common::realpath(substr($arg, 11));
776
+                    // It may not exist and return false instead.
777
+                    if ($this->reportFile === false) {
778
+                        $this->reportFile = substr($arg, 12);
766 779
 
767
-                // It may not exist and return false instead, so use whatever they gave us.
768
-                if ($this->stdinPath === false) {
769
-                    $this->stdinPath = trim(substr($arg, 11));
770
-                }
780
+                        $dir = dirname($this->reportFile);
781
+                        if (is_dir($dir) === false) {
782
+                            echo 'ERROR: The specified report file path "'.$this->reportFile.'" points to a non-existent directory'.PHP_EOL.PHP_EOL;
783
+                            $this->printUsage();
784
+                            exit(2);
785
+                        }
771 786
 
772
-                $this->overriddenDefaults['stdinPath'] = true;
773
-            } else if (PHP_CODESNIFFER_CBF === false && substr($arg, 0, 12) === 'report-file=') {
774
-                $this->reportFile = Util\Common::realpath(substr($arg, 12));
787
+                        if ($dir === '.') {
788
+                            // Passed report file is a file in the current directory.
789
+                            $this->reportFile = getcwd().'/'.basename($this->reportFile);
790
+                        } else {
791
+                            $dir = Util\Common::realpath(getcwd().'/'.$dir);
792
+                            if ($dir !== false) {
793
+                                // Report file path is relative.
794
+                                $this->reportFile = $dir.'/'.basename($this->reportFile);
795
+                            }
796
+                        }
797
+                    }//end if
775 798
 
776
-                // It may not exist and return false instead.
777
-                if ($this->reportFile === false) {
778
-                    $this->reportFile = substr($arg, 12);
799
+                    $this->overriddenDefaults['reportFile'] = true;
779 800
 
780
-                    $dir = dirname($this->reportFile);
781
-                    if (is_dir($dir) === false) {
782
-                        echo 'ERROR: The specified report file path "'.$this->reportFile.'" points to a non-existent directory'.PHP_EOL.PHP_EOL;
801
+                    if (is_dir($this->reportFile) === true) {
802
+                        echo 'ERROR: The specified report file path "'.$this->reportFile.'" is a directory'.PHP_EOL.PHP_EOL;
783 803
                         $this->printUsage();
784 804
                         exit(2);
785 805
                     }
786
-
787
-                    if ($dir === '.') {
788
-                        // Passed report file is a file in the current directory.
789
-                        $this->reportFile = getcwd().'/'.basename($this->reportFile);
790
-                    } else {
791
-                        $dir = Util\Common::realpath(getcwd().'/'.$dir);
792
-                        if ($dir !== false) {
793
-                            // Report file path is relative.
794
-                            $this->reportFile = $dir.'/'.basename($this->reportFile);
795
-                        }
806
+                } else if (substr($arg, 0, 13) === 'report-width=') {
807
+                    if (isset($this->overriddenDefaults['reportWidth']) === true) {
808
+                        break;
796 809
                     }
797
-                }//end if
798
-
799
-                $this->overriddenDefaults['reportFile'] = true;
800 810
 
801
-                if (is_dir($this->reportFile) === true) {
802
-                    echo 'ERROR: The specified report file path "'.$this->reportFile.'" is a directory'.PHP_EOL.PHP_EOL;
803
-                    $this->printUsage();
804
-                    exit(2);
805
-                }
806
-            } else if (substr($arg, 0, 13) === 'report-width=') {
807
-                if (isset($this->overriddenDefaults['reportWidth']) === true) {
808
-                    break;
809
-                }
810
-
811
-                $this->reportWidth = substr($arg, 13);
812
-                $this->overriddenDefaults['reportWidth'] = true;
813
-            } else if (substr($arg, 0, 9) === 'basepath=') {
814
-                if (isset($this->overriddenDefaults['basepath']) === true) {
815
-                    break;
816
-                }
811
+                    $this->reportWidth = substr($arg, 13);
812
+                    $this->overriddenDefaults['reportWidth'] = true;
813
+                } else if (substr($arg, 0, 9) === 'basepath=') {
814
+                    if (isset($this->overriddenDefaults['basepath']) === true) {
815
+                        break;
816
+                    }
817 817
 
818
-                $this->basepath = Util\Common::realpath(substr($arg, 9));
818
+                    $this->basepath = Util\Common::realpath(substr($arg, 9));
819 819
 
820
-                // It may not exist and return false instead.
821
-                if ($this->basepath === false) {
822
-                    $this->basepath = substr($arg, 9);
823
-                }
820
+                    // It may not exist and return false instead.
821
+                    if ($this->basepath === false) {
822
+                        $this->basepath = substr($arg, 9);
823
+                    }
824 824
 
825
-                $this->overriddenDefaults['basepath'] = true;
825
+                    $this->overriddenDefaults['basepath'] = true;
826 826
 
827
-                if (is_dir($this->basepath) === false) {
828
-                    echo 'ERROR: The specified basepath "'.$this->basepath.'" points to a non-existent directory'.PHP_EOL.PHP_EOL;
829
-                    $this->printUsage();
830
-                    exit(2);
831
-                }
832
-            } else if ((substr($arg, 0, 7) === 'report=' || substr($arg, 0, 7) === 'report-')) {
833
-                $reports = array();
834
-
835
-                if ($arg[6] === '-') {
836
-                    // This is a report with file output.
837
-                    $split = strpos($arg, '=');
838
-                    if ($split === false) {
839
-                        $report = substr($arg, 7);
840
-                        $output = null;
841
-                    } else {
842
-                        $report = substr($arg, 7, ($split - 7));
843
-                        $output = substr($arg, ($split + 1));
844
-                        if ($output === false) {
827
+                    if (is_dir($this->basepath) === false) {
828
+                        echo 'ERROR: The specified basepath "'.$this->basepath.'" points to a non-existent directory'.PHP_EOL.PHP_EOL;
829
+                        $this->printUsage();
830
+                        exit(2);
831
+                    }
832
+                } else if ((substr($arg, 0, 7) === 'report=' || substr($arg, 0, 7) === 'report-')) {
833
+                    $reports = array();
834
+
835
+                    if ($arg[6] === '-') {
836
+                        // This is a report with file output.
837
+                        $split = strpos($arg, '=');
838
+                        if ($split === false) {
839
+                            $report = substr($arg, 7);
845 840
                             $output = null;
846 841
                         } else {
847
-                            $dir = dirname($output);
848
-                            if ($dir === '.') {
849
-                                // Passed report file is a filename in the current directory.
850
-                                $output = getcwd().'/'.basename($output);
842
+                            $report = substr($arg, 7, ($split - 7));
843
+                            $output = substr($arg, ($split + 1));
844
+                            if ($output === false) {
845
+                                $output = null;
851 846
                             } else {
852
-                                $dir = Util\Common::realpath(getcwd().'/'.$dir);
853
-                                if ($dir !== false) {
854
-                                    // Report file path is relative.
855
-                                    $output = $dir.'/'.basename($output);
847
+                                $dir = dirname($output);
848
+                                if ($dir === '.') {
849
+                                    // Passed report file is a filename in the current directory.
850
+                                    $output = getcwd().'/'.basename($output);
851
+                                } else {
852
+                                    $dir = Util\Common::realpath(getcwd().'/'.$dir);
853
+                                    if ($dir !== false) {
854
+                                        // Report file path is relative.
855
+                                        $output = $dir.'/'.basename($output);
856
+                                    }
856 857
                                 }
857
-                            }
858
+                            }//end if
858 859
                         }//end if
860
+
861
+                        $reports[$report] = $output;
862
+                    } else {
863
+                        // This is a single report.
864
+                        if (isset($this->overriddenDefaults['reports']) === true) {
865
+                            break;
866
+                        }
867
+
868
+                        $reportNames = explode(',', substr($arg, 7));
869
+                        foreach ($reportNames as $report) {
870
+                            $reports[$report] = null;
871
+                        }
859 872
                     }//end if
860 873
 
861
-                    $reports[$report] = $output;
862
-                } else {
863
-                    // This is a single report.
864
-                    if (isset($this->overriddenDefaults['reports']) === true) {
865
-                        break;
874
+                    // Remove the default value so the CLI value overrides it.
875
+                    if (isset($this->overriddenDefaults['reports']) === false) {
876
+                        $this->reports = $reports;
877
+                    } else {
878
+                        $this->reports = array_merge($this->reports, $reports);
866 879
                     }
867 880
 
868
-                    $reportNames = explode(',', substr($arg, 7));
869
-                    foreach ($reportNames as $report) {
870
-                        $reports[$report] = null;
881
+                    $this->overriddenDefaults['reports'] = true;
882
+                } else if (substr($arg, 0, 7) === 'filter=') {
883
+                    if (isset($this->overriddenDefaults['filter']) === true) {
884
+                        break;
871 885
                     }
872
-                }//end if
873 886
 
874
-                // Remove the default value so the CLI value overrides it.
875
-                if (isset($this->overriddenDefaults['reports']) === false) {
876
-                    $this->reports = $reports;
877
-                } else {
878
-                    $this->reports = array_merge($this->reports, $reports);
879
-                }
880
-
881
-                $this->overriddenDefaults['reports'] = true;
882
-            } else if (substr($arg, 0, 7) === 'filter=') {
883
-                if (isset($this->overriddenDefaults['filter']) === true) {
884
-                    break;
885
-                }
887
+                    $this->filter = substr($arg, 7);
888
+                    $this->overriddenDefaults['filter'] = true;
889
+                } else if (substr($arg, 0, 9) === 'standard=') {
890
+                    $standards = trim(substr($arg, 9));
891
+                    if ($standards !== '') {
892
+                        $this->standards = explode(',', $standards);
893
+                    }
886 894
 
887
-                $this->filter = substr($arg, 7);
888
-                $this->overriddenDefaults['filter'] = true;
889
-            } else if (substr($arg, 0, 9) === 'standard=') {
890
-                $standards = trim(substr($arg, 9));
891
-                if ($standards !== '') {
892
-                    $this->standards = explode(',', $standards);
893
-                }
895
+                    $this->overriddenDefaults['standards'] = true;
896
+                } else if (substr($arg, 0, 11) === 'extensions=') {
897
+                    $extensions    = explode(',', substr($arg, 11));
898
+                    $newExtensions = array();
899
+                    foreach ($extensions as $ext) {
900
+                        $slash = strpos($ext, '/');
901
+                        if ($slash !== false) {
902
+                            // They specified the tokenizer too.
903
+                            list($ext, $tokenizer) = explode('/', $ext);
904
+                            $newExtensions[$ext]   = strtoupper($tokenizer);
905
+                            continue;
906
+                        }
894 907
 
895
-                $this->overriddenDefaults['standards'] = true;
896
-            } else if (substr($arg, 0, 11) === 'extensions=') {
897
-                $extensions    = explode(',', substr($arg, 11));
898
-                $newExtensions = array();
899
-                foreach ($extensions as $ext) {
900
-                    $slash = strpos($ext, '/');
901
-                    if ($slash !== false) {
902
-                        // They specified the tokenizer too.
903
-                        list($ext, $tokenizer) = explode('/', $ext);
904
-                        $newExtensions[$ext]   = strtoupper($tokenizer);
905
-                        continue;
908
+                        if (isset($this->extensions[$ext]) === true) {
909
+                            $newExtensions[$ext] = $this->extensions[$ext];
910
+                        } else {
911
+                            $newExtensions[$ext] = 'PHP';
912
+                        }
906 913
                     }
907 914
 
908
-                    if (isset($this->extensions[$ext]) === true) {
909
-                        $newExtensions[$ext] = $this->extensions[$ext];
910
-                    } else {
911
-                        $newExtensions[$ext] = 'PHP';
912
-                    }
913
-                }
915
+                    $this->extensions = $newExtensions;
916
+                    $this->overriddenDefaults['extensions'] = true;
917
+                } else if (substr($arg, 0, 7) === 'suffix=') {
918
+                    $this->suffix = explode(',', substr($arg, 7));
919
+                    $this->overriddenDefaults['suffix'] = true;
920
+                } else if (substr($arg, 0, 9) === 'parallel=') {
921
+                    $this->parallel = max((int) substr($arg, 9), 1);
922
+                    $this->overriddenDefaults['parallel'] = true;
923
+                } else if (substr($arg, 0, 9) === 'severity=') {
924
+                    $this->errorSeverity   = (int) substr($arg, 9);
925
+                    $this->warningSeverity = $this->errorSeverity;
926
+                    $this->overriddenDefaults['errorSeverity']   = true;
927
+                    $this->overriddenDefaults['warningSeverity'] = true;
928
+                } else if (substr($arg, 0, 15) === 'error-severity=') {
929
+                    $this->errorSeverity = (int) substr($arg, 15);
930
+                    $this->overriddenDefaults['errorSeverity'] = true;
931
+                } else if (substr($arg, 0, 17) === 'warning-severity=') {
932
+                    $this->warningSeverity = (int) substr($arg, 17);
933
+                    $this->overriddenDefaults['warningSeverity'] = true;
934
+                } else if (substr($arg, 0, 7) === 'ignore=') {
935
+                    // Split the ignore string on commas, unless the comma is escaped
936
+                    // using 1 or 3 slashes (\, or \\\,).
937
+                    $patterns = preg_split(
938
+                        '/(?<=(?<!\\\\)\\\\\\\\),|(?<!\\\\),/',
939
+                        substr($arg, 7)
940
+                    );
941
+
942
+                    $ignored = array();
943
+                    foreach ($patterns as $pattern) {
944
+                        $pattern = trim($pattern);
945
+                        if ($pattern === '') {
946
+                            continue;
947
+                        }
914 948
 
915
-                $this->extensions = $newExtensions;
916
-                $this->overriddenDefaults['extensions'] = true;
917
-            } else if (substr($arg, 0, 7) === 'suffix=') {
918
-                $this->suffix = explode(',', substr($arg, 7));
919
-                $this->overriddenDefaults['suffix'] = true;
920
-            } else if (substr($arg, 0, 9) === 'parallel=') {
921
-                $this->parallel = max((int) substr($arg, 9), 1);
922
-                $this->overriddenDefaults['parallel'] = true;
923
-            } else if (substr($arg, 0, 9) === 'severity=') {
924
-                $this->errorSeverity   = (int) substr($arg, 9);
925
-                $this->warningSeverity = $this->errorSeverity;
926
-                $this->overriddenDefaults['errorSeverity']   = true;
927
-                $this->overriddenDefaults['warningSeverity'] = true;
928
-            } else if (substr($arg, 0, 15) === 'error-severity=') {
929
-                $this->errorSeverity = (int) substr($arg, 15);
930
-                $this->overriddenDefaults['errorSeverity'] = true;
931
-            } else if (substr($arg, 0, 17) === 'warning-severity=') {
932
-                $this->warningSeverity = (int) substr($arg, 17);
933
-                $this->overriddenDefaults['warningSeverity'] = true;
934
-            } else if (substr($arg, 0, 7) === 'ignore=') {
935
-                // Split the ignore string on commas, unless the comma is escaped
936
-                // using 1 or 3 slashes (\, or \\\,).
937
-                $patterns = preg_split(
938
-                    '/(?<=(?<!\\\\)\\\\\\\\),|(?<!\\\\),/',
939
-                    substr($arg, 7)
940
-                );
941
-
942
-                $ignored = array();
943
-                foreach ($patterns as $pattern) {
944
-                    $pattern = trim($pattern);
945
-                    if ($pattern === '') {
946
-                        continue;
949
+                        $ignored[$pattern] = 'absolute';
947 950
                     }
948 951
 
949
-                    $ignored[$pattern] = 'absolute';
950
-                }
951
-
952
-                $this->ignored = $ignored;
953
-                $this->overriddenDefaults['ignored'] = true;
954
-            } else if (substr($arg, 0, 10) === 'generator='
955
-                && PHP_CODESNIFFER_CBF === false
956
-            ) {
957
-                $this->generator = substr($arg, 10);
958
-                $this->overriddenDefaults['generator'] = true;
959
-            } else if (substr($arg, 0, 9) === 'encoding=') {
960
-                $this->encoding = strtolower(substr($arg, 9));
961
-                $this->overriddenDefaults['encoding'] = true;
962
-            } else if (substr($arg, 0, 10) === 'tab-width=') {
963
-                $this->tabWidth = (int) substr($arg, 10);
964
-                $this->overriddenDefaults['tabWidth'] = true;
965
-            } else {
966
-                if ($this->dieOnUnknownArg === false) {
967
-                    $eqPos = strpos($arg, '=');
968
-                    if ($eqPos === false) {
969
-                        $this->values[$arg] = $arg;
952
+                    $this->ignored = $ignored;
953
+                    $this->overriddenDefaults['ignored'] = true;
954
+                } else if (substr($arg, 0, 10) === 'generator='
955
+                    && PHP_CODESNIFFER_CBF === false
956
+                ) {
957
+                    $this->generator = substr($arg, 10);
958
+                    $this->overriddenDefaults['generator'] = true;
959
+                } else if (substr($arg, 0, 9) === 'encoding=') {
960
+                    $this->encoding = strtolower(substr($arg, 9));
961
+                    $this->overriddenDefaults['encoding'] = true;
962
+                } else if (substr($arg, 0, 10) === 'tab-width=') {
963
+                    $this->tabWidth = (int) substr($arg, 10);
964
+                    $this->overriddenDefaults['tabWidth'] = true;
965
+                } else {
966
+                    if ($this->dieOnUnknownArg === false) {
967
+                        $eqPos = strpos($arg, '=');
968
+                        if ($eqPos === false) {
969
+                            $this->values[$arg] = $arg;
970
+                        } else {
971
+                            $value = substr($arg, ($eqPos + 1));
972
+                            $arg   = substr($arg, 0, $eqPos);
973
+                            $this->values[$arg] = $value;
974
+                        }
970 975
                     } else {
971
-                        $value = substr($arg, ($eqPos + 1));
972
-                        $arg   = substr($arg, 0, $eqPos);
973
-                        $this->values[$arg] = $value;
976
+                        $this->processUnknownArgument('--'.$arg, $pos);
974 977
                     }
975
-                } else {
976
-                    $this->processUnknownArgument('--'.$arg, $pos);
977
-                }
978
-            }//end if
978
+                }//end if
979 979
 
980
-            break;
980
+                break;
981 981
         }//end switch
982 982
 
983 983
     }//end processLongArgument()
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
      *
278 278
      * @return void
279 279
      */
280
-    public function __construct(array $cliArgs=array(), $dieOnUnknownArg=true)
280
+    public function __construct(array $cliArgs = array(), $dieOnUnknownArg = true)
281 281
     {
282 282
         if (defined('PHP_CODESNIFFER_IN_TESTS') === true) {
283 283
             // Let everything through during testing so that we can
@@ -1224,7 +1224,7 @@  discard block
 block discarded – undo
1224 1224
      * @see    getConfigData()
1225 1225
      * @throws RuntimeException If the config file can not be written.
1226 1226
      */
1227
-    public static function setConfigData($key, $value, $temp=false)
1227
+    public static function setConfigData($key, $value, $temp = false)
1228 1228
     {
1229 1229
         if ($temp === false) {
1230 1230
             $configFile = dirname(__FILE__).'/../CodeSniffer.conf';
Please login to merge, or discard this patch.
src/Tokenizers/PHP.php 2 patches
Indentation   +137 added lines, -137 removed lines patch added patch discarded remove patch
@@ -28,232 +28,232 @@  discard block
 block discarded – undo
28 28
     public $scopeOpeners = array(
29 29
                             T_IF            => array(
30 30
                                                 'start'  => array(
31
-                                                             T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET,
32
-                                                             T_COLON              => T_COLON,
31
+                                                                T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET,
32
+                                                                T_COLON              => T_COLON,
33 33
                                                             ),
34 34
                                                 'end'    => array(
35
-                                                             T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET,
36
-                                                             T_ENDIF               => T_ENDIF,
37
-                                                             T_ELSE                => T_ELSE,
38
-                                                             T_ELSEIF              => T_ELSEIF,
35
+                                                                T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET,
36
+                                                                T_ENDIF               => T_ENDIF,
37
+                                                                T_ELSE                => T_ELSE,
38
+                                                                T_ELSEIF              => T_ELSEIF,
39 39
                                                             ),
40 40
                                                 'strict' => false,
41 41
                                                 'shared' => false,
42 42
                                                 'with'   => array(
43
-                                                             T_ELSE   => T_ELSE,
44
-                                                             T_ELSEIF => T_ELSEIF,
43
+                                                                T_ELSE   => T_ELSE,
44
+                                                                T_ELSEIF => T_ELSEIF,
45 45
                                                             ),
46
-                                               ),
46
+                                                ),
47 47
                             T_TRY           => array(
48 48
                                                 'start'  => array(T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET),
49 49
                                                 'end'    => array(T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET),
50 50
                                                 'strict' => true,
51 51
                                                 'shared' => false,
52 52
                                                 'with'   => array(),
53
-                                               ),
53
+                                                ),
54 54
                             T_CATCH         => array(
55 55
                                                 'start'  => array(T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET),
56 56
                                                 'end'    => array(T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET),
57 57
                                                 'strict' => true,
58 58
                                                 'shared' => false,
59 59
                                                 'with'   => array(),
60
-                                               ),
60
+                                                ),
61 61
                             T_FINALLY       => array(
62 62
                                                 'start'  => array(T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET),
63 63
                                                 'end'    => array(T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET),
64 64
                                                 'strict' => true,
65 65
                                                 'shared' => false,
66 66
                                                 'with'   => array(),
67
-                                               ),
67
+                                                ),
68 68
                             T_ELSE          => array(
69 69
                                                 'start'  => array(
70
-                                                             T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET,
71
-                                                             T_COLON              => T_COLON,
70
+                                                                T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET,
71
+                                                                T_COLON              => T_COLON,
72 72
                                                             ),
73 73
                                                 'end'    => array(
74
-                                                             T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET,
75
-                                                             T_ENDIF               => T_ENDIF,
74
+                                                                T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET,
75
+                                                                T_ENDIF               => T_ENDIF,
76 76
                                                             ),
77 77
                                                 'strict' => false,
78 78
                                                 'shared' => false,
79 79
                                                 'with'   => array(
80
-                                                             T_IF     => T_IF,
81
-                                                             T_ELSEIF => T_ELSEIF,
80
+                                                                T_IF     => T_IF,
81
+                                                                T_ELSEIF => T_ELSEIF,
82 82
                                                             ),
83
-                                               ),
83
+                                                ),
84 84
                             T_ELSEIF        => array(
85 85
                                                 'start'  => array(
86
-                                                             T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET,
87
-                                                             T_COLON              => T_COLON,
86
+                                                                T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET,
87
+                                                                T_COLON              => T_COLON,
88 88
                                                             ),
89 89
                                                 'end'    => array(
90
-                                                             T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET,
91
-                                                             T_ENDIF               => T_ENDIF,
92
-                                                             T_ELSE                => T_ELSE,
93
-                                                             T_ELSEIF              => T_ELSEIF,
90
+                                                                T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET,
91
+                                                                T_ENDIF               => T_ENDIF,
92
+                                                                T_ELSE                => T_ELSE,
93
+                                                                T_ELSEIF              => T_ELSEIF,
94 94
                                                             ),
95 95
                                                 'strict' => false,
96 96
                                                 'shared' => false,
97 97
                                                 'with'   => array(
98
-                                                             T_IF   => T_IF,
99
-                                                             T_ELSE => T_ELSE,
98
+                                                                T_IF   => T_IF,
99
+                                                                T_ELSE => T_ELSE,
100 100
                                                             ),
101
-                                               ),
101
+                                                ),
102 102
                             T_FOR           => array(
103 103
                                                 'start'  => array(
104
-                                                             T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET,
105
-                                                             T_COLON              => T_COLON,
104
+                                                                T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET,
105
+                                                                T_COLON              => T_COLON,
106 106
                                                             ),
107 107
                                                 'end'    => array(
108
-                                                             T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET,
109
-                                                             T_ENDFOR              => T_ENDFOR,
108
+                                                                T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET,
109
+                                                                T_ENDFOR              => T_ENDFOR,
110 110
                                                             ),
111 111
                                                 'strict' => false,
112 112
                                                 'shared' => false,
113 113
                                                 'with'   => array(),
114
-                                               ),
114
+                                                ),
115 115
                             T_FOREACH       => array(
116 116
                                                 'start'  => array(
117
-                                                             T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET,
118
-                                                             T_COLON              => T_COLON,
117
+                                                                T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET,
118
+                                                                T_COLON              => T_COLON,
119 119
                                                             ),
120 120
                                                 'end'    => array(
121
-                                                             T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET,
122
-                                                             T_ENDFOREACH          => T_ENDFOREACH,
121
+                                                                T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET,
122
+                                                                T_ENDFOREACH          => T_ENDFOREACH,
123 123
                                                             ),
124 124
                                                 'strict' => false,
125 125
                                                 'shared' => false,
126 126
                                                 'with'   => array(),
127
-                                               ),
127
+                                                ),
128 128
                             T_INTERFACE     => array(
129 129
                                                 'start'  => array(T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET),
130 130
                                                 'end'    => array(T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET),
131 131
                                                 'strict' => true,
132 132
                                                 'shared' => false,
133 133
                                                 'with'   => array(),
134
-                                               ),
134
+                                                ),
135 135
                             T_FUNCTION      => array(
136 136
                                                 'start'  => array(T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET),
137 137
                                                 'end'    => array(T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET),
138 138
                                                 'strict' => true,
139 139
                                                 'shared' => false,
140 140
                                                 'with'   => array(),
141
-                                               ),
141
+                                                ),
142 142
                             T_CLASS         => array(
143 143
                                                 'start'  => array(T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET),
144 144
                                                 'end'    => array(T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET),
145 145
                                                 'strict' => true,
146 146
                                                 'shared' => false,
147 147
                                                 'with'   => array(),
148
-                                               ),
148
+                                                ),
149 149
                             T_TRAIT         => array(
150 150
                                                 'start'  => array(T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET),
151 151
                                                 'end'    => array(T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET),
152 152
                                                 'strict' => true,
153 153
                                                 'shared' => false,
154 154
                                                 'with'   => array(),
155
-                                               ),
155
+                                                ),
156 156
                             T_USE           => array(
157 157
                                                 'start'  => array(T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET),
158 158
                                                 'end'    => array(T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET),
159 159
                                                 'strict' => false,
160 160
                                                 'shared' => false,
161 161
                                                 'with'   => array(),
162
-                                               ),
162
+                                                ),
163 163
                             T_DECLARE       => array(
164 164
                                                 'start'  => array(T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET),
165 165
                                                 'end'    => array(T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET),
166 166
                                                 'strict' => false,
167 167
                                                 'shared' => false,
168 168
                                                 'with'   => array(),
169
-                                               ),
169
+                                                ),
170 170
                             T_NAMESPACE     => array(
171 171
                                                 'start'  => array(T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET),
172 172
                                                 'end'    => array(T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET),
173 173
                                                 'strict' => false,
174 174
                                                 'shared' => false,
175 175
                                                 'with'   => array(),
176
-                                               ),
176
+                                                ),
177 177
                             T_WHILE         => array(
178 178
                                                 'start'  => array(
179
-                                                             T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET,
180
-                                                             T_COLON              => T_COLON,
179
+                                                                T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET,
180
+                                                                T_COLON              => T_COLON,
181 181
                                                             ),
182 182
                                                 'end'    => array(
183
-                                                             T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET,
184
-                                                             T_ENDWHILE            => T_ENDWHILE,
183
+                                                                T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET,
184
+                                                                T_ENDWHILE            => T_ENDWHILE,
185 185
                                                             ),
186 186
                                                 'strict' => false,
187 187
                                                 'shared' => false,
188 188
                                                 'with'   => array(),
189
-                                               ),
189
+                                                ),
190 190
                             T_DO            => array(
191 191
                                                 'start'  => array(T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET),
192 192
                                                 'end'    => array(T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET),
193 193
                                                 'strict' => true,
194 194
                                                 'shared' => false,
195 195
                                                 'with'   => array(),
196
-                                               ),
196
+                                                ),
197 197
                             T_SWITCH        => array(
198 198
                                                 'start'  => array(
199
-                                                             T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET,
200
-                                                             T_COLON              => T_COLON,
199
+                                                                T_OPEN_CURLY_BRACKET => T_OPEN_CURLY_BRACKET,
200
+                                                                T_COLON              => T_COLON,
201 201
                                                             ),
202 202
                                                 'end'    => array(
203
-                                                             T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET,
204
-                                                             T_ENDSWITCH           => T_ENDSWITCH,
203
+                                                                T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET,
204
+                                                                T_ENDSWITCH           => T_ENDSWITCH,
205 205
                                                             ),
206 206
                                                 'strict' => true,
207 207
                                                 'shared' => false,
208 208
                                                 'with'   => array(),
209
-                                               ),
209
+                                                ),
210 210
                             T_CASE          => array(
211 211
                                                 'start'  => array(
212
-                                                             T_COLON     => T_COLON,
213
-                                                             T_SEMICOLON => T_SEMICOLON,
212
+                                                                T_COLON     => T_COLON,
213
+                                                                T_SEMICOLON => T_SEMICOLON,
214 214
                                                             ),
215 215
                                                 'end'    => array(
216
-                                                             T_BREAK    => T_BREAK,
217
-                                                             T_RETURN   => T_RETURN,
218
-                                                             T_CONTINUE => T_CONTINUE,
219
-                                                             T_THROW    => T_THROW,
220
-                                                             T_EXIT     => T_EXIT,
216
+                                                                T_BREAK    => T_BREAK,
217
+                                                                T_RETURN   => T_RETURN,
218
+                                                                T_CONTINUE => T_CONTINUE,
219
+                                                                T_THROW    => T_THROW,
220
+                                                                T_EXIT     => T_EXIT,
221 221
                                                             ),
222 222
                                                 'strict' => true,
223 223
                                                 'shared' => true,
224 224
                                                 'with'   => array(
225
-                                                             T_DEFAULT => T_DEFAULT,
226
-                                                             T_CASE    => T_CASE,
227
-                                                             T_SWITCH  => T_SWITCH,
225
+                                                                T_DEFAULT => T_DEFAULT,
226
+                                                                T_CASE    => T_CASE,
227
+                                                                T_SWITCH  => T_SWITCH,
228 228
                                                             ),
229
-                                               ),
229
+                                                ),
230 230
                             T_DEFAULT       => array(
231 231
                                                 'start'  => array(
232
-                                                             T_COLON     => T_COLON,
233
-                                                             T_SEMICOLON => T_SEMICOLON,
232
+                                                                T_COLON     => T_COLON,
233
+                                                                T_SEMICOLON => T_SEMICOLON,
234 234
                                                             ),
235 235
                                                 'end'    => array(
236
-                                                             T_BREAK    => T_BREAK,
237
-                                                             T_RETURN   => T_RETURN,
238
-                                                             T_CONTINUE => T_CONTINUE,
239
-                                                             T_THROW    => T_THROW,
240
-                                                             T_EXIT     => T_EXIT,
236
+                                                                T_BREAK    => T_BREAK,
237
+                                                                T_RETURN   => T_RETURN,
238
+                                                                T_CONTINUE => T_CONTINUE,
239
+                                                                T_THROW    => T_THROW,
240
+                                                                T_EXIT     => T_EXIT,
241 241
                                                             ),
242 242
                                                 'strict' => true,
243 243
                                                 'shared' => true,
244 244
                                                 'with'   => array(
245
-                                                             T_CASE   => T_CASE,
246
-                                                             T_SWITCH => T_SWITCH,
245
+                                                                T_CASE   => T_CASE,
246
+                                                                T_SWITCH => T_SWITCH,
247 247
                                                             ),
248
-                                               ),
248
+                                                ),
249 249
                             T_START_HEREDOC => array(
250 250
                                                 'start'  => array(T_START_HEREDOC => T_START_HEREDOC),
251 251
                                                 'end'    => array(T_END_HEREDOC => T_END_HEREDOC),
252 252
                                                 'strict' => true,
253 253
                                                 'shared' => false,
254 254
                                                 'with'   => array(),
255
-                                               ),
256
-                           );
255
+                                                ),
256
+                            );
257 257
 
258 258
     /**
259 259
      * A list of tokens that end the scope.
@@ -265,15 +265,15 @@  discard block
 block discarded – undo
265 265
      * @var array
266 266
      */
267 267
     public $endScopeTokens = array(
268
-                              T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET,
269
-                              T_ENDIF               => T_ENDIF,
270
-                              T_ENDFOR              => T_ENDFOR,
271
-                              T_ENDFOREACH          => T_ENDFOREACH,
272
-                              T_ENDWHILE            => T_ENDWHILE,
273
-                              T_ENDSWITCH           => T_ENDSWITCH,
274
-                              T_BREAK               => T_BREAK,
275
-                              T_END_HEREDOC         => T_END_HEREDOC,
276
-                             );
268
+                                T_CLOSE_CURLY_BRACKET => T_CLOSE_CURLY_BRACKET,
269
+                                T_ENDIF               => T_ENDIF,
270
+                                T_ENDFOR              => T_ENDFOR,
271
+                                T_ENDFOREACH          => T_ENDFOREACH,
272
+                                T_ENDWHILE            => T_ENDWHILE,
273
+                                T_ENDSWITCH           => T_ENDSWITCH,
274
+                                T_BREAK               => T_BREAK,
275
+                                T_END_HEREDOC         => T_END_HEREDOC,
276
+                                );
277 277
 
278 278
     /**
279 279
      * Known lengths of tokens.
@@ -423,7 +423,7 @@  discard block
 block discarded – undo
423 423
                             T_BACKTICK                 => 1,
424 424
                             T_OPEN_SHORT_ARRAY         => 1,
425 425
                             T_CLOSE_SHORT_ARRAY        => 1,
426
-                           );
426
+                            );
427 427
 
428 428
 
429 429
     /**
@@ -555,10 +555,10 @@  discard block
 block discarded – undo
555 555
                 // Binary casts need a special token.
556 556
                 if ($token[0] === 'b"') {
557 557
                     $finalTokens[$newStackPtr] = array(
558
-                                                  'code'    => T_BINARY_CAST,
559
-                                                  'type'    => 'T_BINARY_CAST',
560
-                                                  'content' => 'b',
561
-                                                 );
558
+                                                    'code'    => T_BINARY_CAST,
559
+                                                    'type'    => 'T_BINARY_CAST',
560
+                                                    'content' => 'b',
561
+                                                    );
562 562
                     $newStackPtr++;
563 563
                 }
564 564
 
@@ -842,10 +842,10 @@  discard block
 block discarded – undo
842 842
                 && $tokens[($stackPtr - 1)][0] !== T_OBJECT_OPERATOR
843 843
             ) {
844 844
                 $finalTokens[$newStackPtr] = array(
845
-                                              'content' => $token[1],
846
-                                              'code'    => T_TRAIT,
847
-                                              'type'    => 'T_TRAIT',
848
-                                             );
845
+                                                'content' => $token[1],
846
+                                                'code'    => T_TRAIT,
847
+                                                'type'    => 'T_TRAIT',
848
+                                                );
849 849
 
850 850
                 if (PHP_CODESNIFFER_VERBOSITY > 1) {
851 851
                     echo "\t\t* token $stackPtr changed from T_STRING to T_TRAIT".PHP_EOL;
@@ -870,11 +870,11 @@  discard block
 block discarded – undo
870 870
                 && $tokens[($stackPtr - 1)][0] !== T_PAAMAYIM_NEKUDOTAYIM
871 871
             ) {
872 872
                 $stopTokens = array(
873
-                               T_CASE               => true,
874
-                               T_SEMICOLON          => true,
875
-                               T_OPEN_CURLY_BRACKET => true,
876
-                               T_INLINE_THEN        => true,
877
-                              );
873
+                                T_CASE               => true,
874
+                                T_SEMICOLON          => true,
875
+                                T_OPEN_CURLY_BRACKET => true,
876
+                                T_INLINE_THEN        => true,
877
+                                );
878 878
 
879 879
                 for ($x = ($newStackPtr - 1); $x > 0; $x--) {
880 880
                     if (isset($stopTokens[$finalTokens[$x]['code']]) === true) {
@@ -886,10 +886,10 @@  discard block
 block discarded – undo
886 886
                     && $finalTokens[$x]['code'] !== T_INLINE_THEN
887 887
                 ) {
888 888
                     $finalTokens[$newStackPtr] = array(
889
-                                                  'content' => $token[1].':',
890
-                                                  'code'    => T_GOTO_LABEL,
891
-                                                  'type'    => 'T_GOTO_LABEL',
892
-                                                 );
889
+                                                    'content' => $token[1].':',
890
+                                                    'code'    => T_GOTO_LABEL,
891
+                                                    'type'    => 'T_GOTO_LABEL',
892
+                                                    );
893 893
 
894 894
                     if (PHP_CODESNIFFER_VERBOSITY > 1) {
895 895
                         echo "\t\t* token $stackPtr changed from T_STRING to T_GOTO_LABEL".PHP_EOL;
@@ -913,24 +913,24 @@  discard block
 block discarded – undo
913 913
                 && strtolower($token[1]) !== 'elseif'
914 914
             ) {
915 915
                 $finalTokens[$newStackPtr] = array(
916
-                                              'content' => substr($token[1], 0, 4),
917
-                                              'code'    => T_ELSE,
918
-                                              'type'    => 'T_ELSE',
919
-                                             );
916
+                                                'content' => substr($token[1], 0, 4),
917
+                                                'code'    => T_ELSE,
918
+                                                'type'    => 'T_ELSE',
919
+                                                );
920 920
 
921 921
                 $newStackPtr++;
922 922
                 $finalTokens[$newStackPtr] = array(
923
-                                              'content' => substr($token[1], 4, -2),
924
-                                              'code'    => T_WHITESPACE,
925
-                                              'type'    => 'T_WHITESPACE',
926
-                                             );
923
+                                                'content' => substr($token[1], 4, -2),
924
+                                                'code'    => T_WHITESPACE,
925
+                                                'type'    => 'T_WHITESPACE',
926
+                                                );
927 927
 
928 928
                 $newStackPtr++;
929 929
                 $finalTokens[$newStackPtr] = array(
930
-                                              'content' => substr($token[1], -2),
931
-                                              'code'    => T_IF,
932
-                                              'type'    => 'T_IF',
933
-                                             );
930
+                                                'content' => substr($token[1], -2),
931
+                                                'code'    => T_IF,
932
+                                                'type'    => 'T_IF',
933
+                                                );
934 934
 
935 935
                 if (PHP_CODESNIFFER_VERBOSITY > 1) {
936 936
                     echo "\t\t* token $stackPtr changed from T_ELSEIF to T_ELSE/T_WHITESPACE/T_IF".PHP_EOL;
@@ -947,10 +947,10 @@  discard block
 block discarded – undo
947 947
 
948 948
             if ($tokenIsArray === true && token_name($token[0]) === 'T_HASHBANG') {
949 949
                 $finalTokens[$newStackPtr] = array(
950
-                                              'content' => $token[1],
951
-                                              'code'    => T_INLINE_HTML,
952
-                                              'type'    => 'T_INLINE_HTML',
953
-                                             );
950
+                                                'content' => $token[1],
951
+                                                'code'    => T_INLINE_HTML,
952
+                                                'type'    => 'T_INLINE_HTML',
953
+                                                );
954 954
 
955 955
                 if (PHP_CODESNIFFER_VERBOSITY > 1) {
956 956
                     echo "\t\t* token $stackPtr changed from T_HASHBANG to T_INLINE_HTML".PHP_EOL;
@@ -971,10 +971,10 @@  discard block
 block discarded – undo
971 971
                 $tokenLines = explode($this->eolChar, $token[1]);
972 972
                 $numLines   = count($tokenLines);
973 973
                 $newToken   = array(
974
-                               'type'    => token_name($token[0]),
975
-                               'code'    => $token[0],
976
-                               'content' => '',
977
-                              );
974
+                                'type'    => token_name($token[0]),
975
+                                'code'    => $token[0],
976
+                                'content' => '',
977
+                                );
978 978
 
979 979
                 for ($i = 0; $i < $numLines; $i++) {
980 980
                     $newToken['content'] = $tokenLines[$i];
@@ -1005,13 +1005,13 @@  discard block
 block discarded – undo
1005 1005
                                 T_USE                  => true,
1006 1006
                                 T_NAMESPACE            => true,
1007 1007
                                 T_PAAMAYIM_NEKUDOTAYIM => true,
1008
-                               );
1008
+                                );
1009 1009
                     if (isset($context[$finalTokens[$lastNotEmptyToken]['code']]) === true) {
1010 1010
                         $finalTokens[$newStackPtr] = array(
1011
-                                                      'content' => $token[1],
1012
-                                                      'code'    => T_STRING,
1013
-                                                      'type'    => 'T_STRING',
1014
-                                                     );
1011
+                                                        'content' => $token[1],
1012
+                                                        'code'    => T_STRING,
1013
+                                                        'type'    => 'T_STRING',
1014
+                                                        );
1015 1015
                         $newStackPtr++;
1016 1016
                         continue;
1017 1017
                     }
@@ -1309,7 +1309,7 @@  discard block
 block discarded – undo
1309 1309
                             T_CLOSE_PARENTHESIS    => T_CLOSE_PARENTHESIS,
1310 1310
                             T_VARIABLE             => T_VARIABLE,
1311 1311
                             T_STRING               => T_STRING,
1312
-                           );
1312
+                            );
1313 1313
 
1314 1314
                 if (isset($allowed[$this->tokens[$x]['code']]) === false
1315 1315
                     && isset($this->tokens[$i]['bracket_closer']) === true
@@ -1371,7 +1371,7 @@  discard block
 block discarded – undo
1371 1371
                             T_OBJECT_OPERATOR      => true,
1372 1372
                             T_NS_SEPARATOR         => true,
1373 1373
                             T_PAAMAYIM_NEKUDOTAYIM => true,
1374
-                           );
1374
+                            );
1375 1375
                 if (isset($context[$this->tokens[$x]['code']]) === true) {
1376 1376
                     if (PHP_CODESNIFFER_VERBOSITY > 1) {
1377 1377
                         $line = $this->tokens[$i]['line'];
@@ -1604,13 +1604,13 @@  discard block
 block discarded – undo
1604 1604
             self::$_resolveTokenCache[$cacheKey] = $newToken;
1605 1605
         } else if ($token[0] === T_CURLY_OPEN) {
1606 1606
             $newToken = array(
1607
-                         'code' => T_OPEN_CURLY_BRACKET,
1608
-                         'type' => 'T_OPEN_CURLY_BRACKET',
1607
+                            'code' => T_OPEN_CURLY_BRACKET,
1608
+                            'type' => 'T_OPEN_CURLY_BRACKET',
1609 1609
                         );
1610 1610
         } else {
1611 1611
             $newToken = array(
1612
-                         'code' => $token[0],
1613
-                         'type' => token_name($token[0]),
1612
+                            'code' => $token[0],
1613
+                            'type' => token_name($token[0]),
1614 1614
                         );
1615 1615
 
1616 1616
             self::$_resolveTokenCache[$token[0]] = $newToken;
Please login to merge, or discard this patch.
Switch Indentation   +99 added lines, -99 removed lines patch added patch discarded remove patch
@@ -1450,24 +1450,24 @@  discard block
 block discarded – undo
1450 1450
 
1451 1451
         if ($token[0] === T_STRING) {
1452 1452
             switch ($cacheKey) {
1453
-            case 'false':
1454
-                $newToken['type'] = 'T_FALSE';
1455
-                break;
1456
-            case 'true':
1457
-                $newToken['type'] = 'T_TRUE';
1458
-                break;
1459
-            case 'null':
1460
-                $newToken['type'] = 'T_NULL';
1461
-                break;
1462
-            case 'self':
1463
-                $newToken['type'] = 'T_SELF';
1464
-                break;
1465
-            case 'parent':
1466
-                $newToken['type'] = 'T_PARENT';
1467
-                break;
1468
-            default:
1469
-                $newToken['type'] = 'T_STRING';
1470
-                break;
1453
+                case 'false':
1454
+                    $newToken['type'] = 'T_FALSE';
1455
+                    break;
1456
+                case 'true':
1457
+                    $newToken['type'] = 'T_TRUE';
1458
+                    break;
1459
+                case 'null':
1460
+                    $newToken['type'] = 'T_NULL';
1461
+                    break;
1462
+                case 'self':
1463
+                    $newToken['type'] = 'T_SELF';
1464
+                    break;
1465
+                case 'parent':
1466
+                    $newToken['type'] = 'T_PARENT';
1467
+                    break;
1468
+                default:
1469
+                    $newToken['type'] = 'T_STRING';
1470
+                    break;
1471 1471
             }
1472 1472
 
1473 1473
             $newToken['code'] = constant($newToken['type']);
@@ -1509,87 +1509,87 @@  discard block
 block discarded – undo
1509 1509
         $newToken = array();
1510 1510
 
1511 1511
         switch ($token) {
1512
-        case '{':
1513
-            $newToken['type'] = 'T_OPEN_CURLY_BRACKET';
1514
-            break;
1515
-        case '}':
1516
-            $newToken['type'] = 'T_CLOSE_CURLY_BRACKET';
1517
-            break;
1518
-        case '[':
1519
-            $newToken['type'] = 'T_OPEN_SQUARE_BRACKET';
1520
-            break;
1521
-        case ']':
1522
-            $newToken['type'] = 'T_CLOSE_SQUARE_BRACKET';
1523
-            break;
1524
-        case '(':
1525
-            $newToken['type'] = 'T_OPEN_PARENTHESIS';
1526
-            break;
1527
-        case ')':
1528
-            $newToken['type'] = 'T_CLOSE_PARENTHESIS';
1529
-            break;
1530
-        case ':':
1531
-            $newToken['type'] = 'T_COLON';
1532
-            break;
1533
-        case '.':
1534
-            $newToken['type'] = 'T_STRING_CONCAT';
1535
-            break;
1536
-        case '?':
1537
-            $newToken['type'] = 'T_INLINE_THEN';
1538
-            break;
1539
-        case ';':
1540
-            $newToken['type'] = 'T_SEMICOLON';
1541
-            break;
1542
-        case '=':
1543
-            $newToken['type'] = 'T_EQUAL';
1544
-            break;
1545
-        case '*':
1546
-            $newToken['type'] = 'T_MULTIPLY';
1547
-            break;
1548
-        case '/':
1549
-            $newToken['type'] = 'T_DIVIDE';
1550
-            break;
1551
-        case '+':
1552
-            $newToken['type'] = 'T_PLUS';
1553
-            break;
1554
-        case '-':
1555
-            $newToken['type'] = 'T_MINUS';
1556
-            break;
1557
-        case '%':
1558
-            $newToken['type'] = 'T_MODULUS';
1559
-            break;
1560
-        case '^':
1561
-            $newToken['type'] = 'T_BITWISE_XOR';
1562
-            break;
1563
-        case '&':
1564
-            $newToken['type'] = 'T_BITWISE_AND';
1565
-            break;
1566
-        case '|':
1567
-            $newToken['type'] = 'T_BITWISE_OR';
1568
-            break;
1569
-        case '<':
1570
-            $newToken['type'] = 'T_LESS_THAN';
1571
-            break;
1572
-        case '>':
1573
-            $newToken['type'] = 'T_GREATER_THAN';
1574
-            break;
1575
-        case '!':
1576
-            $newToken['type'] = 'T_BOOLEAN_NOT';
1577
-            break;
1578
-        case ',':
1579
-            $newToken['type'] = 'T_COMMA';
1580
-            break;
1581
-        case '@':
1582
-            $newToken['type'] = 'T_ASPERAND';
1583
-            break;
1584
-        case '$':
1585
-            $newToken['type'] = 'T_DOLLAR';
1586
-            break;
1587
-        case '`':
1588
-            $newToken['type'] = 'T_BACKTICK';
1589
-            break;
1590
-        default:
1591
-            $newToken['type'] = 'T_NONE';
1592
-            break;
1512
+            case '{':
1513
+                $newToken['type'] = 'T_OPEN_CURLY_BRACKET';
1514
+                break;
1515
+            case '}':
1516
+                $newToken['type'] = 'T_CLOSE_CURLY_BRACKET';
1517
+                break;
1518
+            case '[':
1519
+                $newToken['type'] = 'T_OPEN_SQUARE_BRACKET';
1520
+                break;
1521
+            case ']':
1522
+                $newToken['type'] = 'T_CLOSE_SQUARE_BRACKET';
1523
+                break;
1524
+            case '(':
1525
+                $newToken['type'] = 'T_OPEN_PARENTHESIS';
1526
+                break;
1527
+            case ')':
1528
+                $newToken['type'] = 'T_CLOSE_PARENTHESIS';
1529
+                break;
1530
+            case ':':
1531
+                $newToken['type'] = 'T_COLON';
1532
+                break;
1533
+            case '.':
1534
+                $newToken['type'] = 'T_STRING_CONCAT';
1535
+                break;
1536
+            case '?':
1537
+                $newToken['type'] = 'T_INLINE_THEN';
1538
+                break;
1539
+            case ';':
1540
+                $newToken['type'] = 'T_SEMICOLON';
1541
+                break;
1542
+            case '=':
1543
+                $newToken['type'] = 'T_EQUAL';
1544
+                break;
1545
+            case '*':
1546
+                $newToken['type'] = 'T_MULTIPLY';
1547
+                break;
1548
+            case '/':
1549
+                $newToken['type'] = 'T_DIVIDE';
1550
+                break;
1551
+            case '+':
1552
+                $newToken['type'] = 'T_PLUS';
1553
+                break;
1554
+            case '-':
1555
+                $newToken['type'] = 'T_MINUS';
1556
+                break;
1557
+            case '%':
1558
+                $newToken['type'] = 'T_MODULUS';
1559
+                break;
1560
+            case '^':
1561
+                $newToken['type'] = 'T_BITWISE_XOR';
1562
+                break;
1563
+            case '&':
1564
+                $newToken['type'] = 'T_BITWISE_AND';
1565
+                break;
1566
+            case '|':
1567
+                $newToken['type'] = 'T_BITWISE_OR';
1568
+                break;
1569
+            case '<':
1570
+                $newToken['type'] = 'T_LESS_THAN';
1571
+                break;
1572
+            case '>':
1573
+                $newToken['type'] = 'T_GREATER_THAN';
1574
+                break;
1575
+            case '!':
1576
+                $newToken['type'] = 'T_BOOLEAN_NOT';
1577
+                break;
1578
+            case ',':
1579
+                $newToken['type'] = 'T_COMMA';
1580
+                break;
1581
+            case '@':
1582
+                $newToken['type'] = 'T_ASPERAND';
1583
+                break;
1584
+            case '$':
1585
+                $newToken['type'] = 'T_DOLLAR';
1586
+                break;
1587
+            case '`':
1588
+                $newToken['type'] = 'T_BACKTICK';
1589
+                break;
1590
+            default:
1591
+                $newToken['type'] = 'T_NONE';
1592
+                break;
1593 1593
         }//end switch
1594 1594
 
1595 1595
         $newToken['code']    = constant($newToken['type']);
Please login to merge, or discard this patch.