Completed
Push — master ( 5751ed...21dc38 )
by Tomáš
16:36 queued 13:05
created
src/Tokenizers/Comment.php 1 patch
Indentation   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -58,11 +58,11 @@  discard block
 block discarded – undo
58 58
         $string  = ltrim($string, '/*');
59 59
 
60 60
         $tokens[$stackPtr] = array(
61
-                              'content'      => $openTag,
62
-                              'code'         => T_DOC_COMMENT_OPEN_TAG,
63
-                              'type'         => 'T_DOC_COMMENT_OPEN_TAG',
64
-                              'comment_tags' => array(),
65
-                             );
61
+                                'content'      => $openTag,
62
+                                'code'         => T_DOC_COMMENT_OPEN_TAG,
63
+                                'type'         => 'T_DOC_COMMENT_OPEN_TAG',
64
+                                'comment_tags' => array(),
65
+                                );
66 66
 
67 67
         $openPtr = $stackPtr;
68 68
         $stackPtr++;
@@ -79,10 +79,10 @@  discard block
 block discarded – undo
79 79
         */
80 80
 
81 81
         $closeTag = array(
82
-                     'content'        => substr($string, strlen(rtrim($string, '/*'))),
83
-                     'code'           => T_DOC_COMMENT_CLOSE_TAG,
84
-                     'type'           => 'T_DOC_COMMENT_CLOSE_TAG',
85
-                     'comment_opener' => $openPtr,
82
+                        'content'        => substr($string, strlen(rtrim($string, '/*'))),
83
+                        'code'           => T_DOC_COMMENT_CLOSE_TAG,
84
+                        'type'           => 'T_DOC_COMMENT_CLOSE_TAG',
85
+                        'comment_opener' => $openPtr,
86 86
                     );
87 87
 
88 88
         $string = rtrim($string, '/*');
@@ -125,10 +125,10 @@  discard block
 block discarded – undo
125 125
                 // This is a function or class doc block line.
126 126
                 $char++;
127 127
                 $tokens[$stackPtr] = array(
128
-                                      'content' => '*',
129
-                                      'code'    => T_DOC_COMMENT_STAR,
130
-                                      'type'    => 'T_DOC_COMMENT_STAR',
131
-                                     );
128
+                                        'content' => '*',
129
+                                        'code'    => T_DOC_COMMENT_STAR,
130
+                                        'type'    => 'T_DOC_COMMENT_STAR',
131
+                                        );
132 132
 
133 133
                 $stackPtr++;
134 134
 
@@ -204,9 +204,9 @@  discard block
 block discarded – undo
204 204
                 $tagName  = $matches[0];
205 205
                 $start   += strlen($tagName);
206 206
                 $tokens[] = array(
207
-                             'content' => $tagName,
208
-                             'code'    => T_DOC_COMMENT_TAG,
209
-                             'type'    => 'T_DOC_COMMENT_TAG',
207
+                                'content' => $tagName,
208
+                                'code'    => T_DOC_COMMENT_TAG,
209
+                                'type'    => 'T_DOC_COMMENT_TAG',
210 210
                             );
211 211
 
212 212
                 // Then there will be some whitespace.
@@ -226,17 +226,17 @@  discard block
 block discarded – undo
226 226
 
227 227
         if ($eol > $start) {
228 228
             $tokens[] = array(
229
-                         'content' => substr($string, $start, ($eol - $start)),
230
-                         'code'    => T_DOC_COMMENT_STRING,
231
-                         'type'    => 'T_DOC_COMMENT_STRING',
229
+                            'content' => substr($string, $start, ($eol - $start)),
230
+                            'code'    => T_DOC_COMMENT_STRING,
231
+                            'type'    => 'T_DOC_COMMENT_STRING',
232 232
                         );
233 233
         }
234 234
 
235 235
         if ($eol !== $end) {
236 236
             $tokens[] = array(
237
-                         'content' => substr($string, $eol, strlen($eolChar)),
238
-                         'code'    => T_DOC_COMMENT_WHITESPACE,
239
-                         'type'    => 'T_DOC_COMMENT_WHITESPACE',
237
+                            'content' => substr($string, $eol, strlen($eolChar)),
238
+                            'code'    => T_DOC_COMMENT_WHITESPACE,
239
+                            'type'    => 'T_DOC_COMMENT_WHITESPACE',
240 240
                         );
241 241
         }
242 242
 
@@ -270,10 +270,10 @@  discard block
 block discarded – undo
270 270
         }
271 271
 
272 272
         $token = array(
273
-                  'content' => $space,
274
-                  'code'    => T_DOC_COMMENT_WHITESPACE,
275
-                  'type'    => 'T_DOC_COMMENT_WHITESPACE',
276
-                 );
273
+                    'content' => $space,
274
+                    'code'    => T_DOC_COMMENT_WHITESPACE,
275
+                    'type'    => 'T_DOC_COMMENT_WHITESPACE',
276
+                    );
277 277
 
278 278
         return $token;
279 279
 
Please login to merge, or discard this patch.
src/Tokenizers/CSS.php 3 patches
Indentation   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -68,10 +68,10 @@  discard block
 block discarded – undo
68 68
 
69 69
         $finalTokens    = array();
70 70
         $finalTokens[0] = array(
71
-                           'code'    => T_OPEN_TAG,
72
-                           'type'    => 'T_OPEN_TAG',
73
-                           'content' => '',
74
-                          );
71
+                            'code'    => T_OPEN_TAG,
72
+                            'type'    => 'T_OPEN_TAG',
73
+                            'content' => '',
74
+                            );
75 75
 
76 76
         $newStackPtr      = 1;
77 77
         $numTokens        = count($tokens);
@@ -124,10 +124,10 @@  discard block
 block discarded – undo
124 124
                 }
125 125
 
126 126
                 $finalTokens[$newStackPtr] = array(
127
-                                              'type'    => 'T_EMBEDDED_PHP',
128
-                                              'code'    => T_EMBEDDED_PHP,
129
-                                              'content' => $content,
130
-                                             );
127
+                                                'type'    => 'T_EMBEDDED_PHP',
128
+                                                'code'    => T_EMBEDDED_PHP,
129
+                                                'content' => $content,
130
+                                                );
131 131
 
132 132
                 $newStackPtr++;
133 133
                 continue;
@@ -137,16 +137,16 @@  discard block
 block discarded – undo
137 137
                 // Convert these back to T_STRING followed by T_COLON so we can
138 138
                 // more easily process style definitions.
139 139
                 $finalTokens[$newStackPtr] = array(
140
-                                              'type'    => 'T_STRING',
141
-                                              'code'    => T_STRING,
142
-                                              'content' => substr($token['content'], 0, -1),
143
-                                             );
140
+                                                'type'    => 'T_STRING',
141
+                                                'code'    => T_STRING,
142
+                                                'content' => substr($token['content'], 0, -1),
143
+                                                );
144 144
                 $newStackPtr++;
145 145
                 $finalTokens[$newStackPtr] = array(
146
-                                              'type'    => 'T_COLON',
147
-                                              'code'    => T_COLON,
148
-                                              'content' => ':',
149
-                                             );
146
+                                                'type'    => 'T_COLON',
147
+                                                'code'    => T_COLON,
148
+                                                'content' => ':',
149
+                                                );
150 150
                 $newStackPtr++;
151 151
                 continue;
152 152
             }
@@ -154,10 +154,10 @@  discard block
 block discarded – undo
154 154
             if ($token['code'] === T_FUNCTION) {
155 155
                 // There are no functions in CSS, so convert this to a string.
156 156
                 $finalTokens[$newStackPtr] = array(
157
-                                              'type'    => 'T_STRING',
158
-                                              'code'    => T_STRING,
159
-                                              'content' => $token['content'],
160
-                                             );
157
+                                                'type'    => 'T_STRING',
158
+                                                'code'    => T_STRING,
159
+                                                'content' => $token['content'],
160
+                                                );
161 161
 
162 162
                 $newStackPtr++;
163 163
                 continue;
@@ -221,23 +221,23 @@  discard block
 block discarded – undo
221 221
                         // Work out what we trimmed off above and remember to re-add it.
222 222
                         $trimmed = substr($token['content'], 0, (strlen($token['content']) - strlen($content)));
223 223
                         $finalTokens[$newStackPtr] = array(
224
-                                                      'type'    => 'T_COLOUR',
225
-                                                      'code'    => T_COLOUR,
226
-                                                      'content' => $trimmed.$firstContent,
227
-                                                     );
224
+                                                        'type'    => 'T_COLOUR',
225
+                                                        'code'    => T_COLOUR,
226
+                                                        'content' => $trimmed.$firstContent,
227
+                                                        );
228 228
                     } else {
229 229
                         $finalTokens[$newStackPtr] = array(
230
-                                                      'type'    => 'T_HASH',
231
-                                                      'code'    => T_HASH,
232
-                                                      'content' => '#',
233
-                                                     );
230
+                                                        'type'    => 'T_HASH',
231
+                                                        'code'    => T_HASH,
232
+                                                        'content' => '#',
233
+                                                        );
234 234
                     }
235 235
                 } else {
236 236
                     $finalTokens[$newStackPtr] = array(
237
-                                                  'type'    => 'T_STRING',
238
-                                                  'code'    => T_STRING,
239
-                                                  'content' => '//',
240
-                                                 );
237
+                                                    'type'    => 'T_STRING',
238
+                                                    'code'    => T_STRING,
239
+                                                    'content' => '//',
240
+                                                    );
241 241
                 }//end if
242 242
 
243 243
                 $newStackPtr++;
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@
 block discarded – undo
29 29
      * @return void
30 30
      * @throws TokenizerException If the file appears to be minified.
31 31
      */
32
-    public function __construct($content, Config $config, $eolChar='\n')
32
+    public function __construct($content, Config $config, $eolChar = '\n')
33 33
     {
34 34
         if ($this->isMinifiedContent($content, $eolChar) === true) {
35 35
             throw new TokenizerException('File appears to be minified and cannot be processed');
Please login to merge, or discard this patch.
Switch Indentation   +131 added lines, -131 removed lines patch added patch discarded remove patch
@@ -284,12 +284,32 @@  discard block
 block discarded – undo
284 284
             }
285 285
 
286 286
             switch ($token['code']) {
287
-            case T_OPEN_CURLY_BRACKET:
288
-                // Opening curly brackets for an At-rule do not start a style
289
-                // definition. We also reset the asperand flag here because the next
290
-                // opening curly bracket could be indeed the start of a style
291
-                // definition.
292
-                if ($asperandStart === true) {
287
+                case T_OPEN_CURLY_BRACKET:
288
+                    // Opening curly brackets for an At-rule do not start a style
289
+                    // definition. We also reset the asperand flag here because the next
290
+                    // opening curly bracket could be indeed the start of a style
291
+                    // definition.
292
+                    if ($asperandStart === true) {
293
+                        if (PHP_CodeSniffer_VERBOSITY > 1) {
294
+                            if ($inStyleDef === true) {
295
+                                echo "\t\t* style definition closed *".PHP_EOL;
296
+                            }
297
+
298
+                            if ($asperandStart === true) {
299
+                                echo "\t\t* at-rule definition closed *".PHP_EOL;
300
+                            }
301
+                        }
302
+
303
+                        $inStyleDef    = false;
304
+                        $asperandStart = false;
305
+                    } else {
306
+                        $inStyleDef = true;
307
+                        if (PHP_CodeSniffer_VERBOSITY > 1) {
308
+                            echo "\t\t* style definition opened *".PHP_EOL;
309
+                        }
310
+                    }
311
+                    break;
312
+                case T_CLOSE_CURLY_BRACKET:
293 313
                     if (PHP_CodeSniffer_VERBOSITY > 1) {
294 314
                         if ($inStyleDef === true) {
295 315
                             echo "\t\t* style definition closed *".PHP_EOL;
@@ -302,162 +322,142 @@  discard block
 block discarded – undo
302 322
 
303 323
                     $inStyleDef    = false;
304 324
                     $asperandStart = false;
305
-                } else {
306
-                    $inStyleDef = true;
307
-                    if (PHP_CodeSniffer_VERBOSITY > 1) {
308
-                        echo "\t\t* style definition opened *".PHP_EOL;
309
-                    }
310
-                }
311
-                break;
312
-            case T_CLOSE_CURLY_BRACKET:
313
-                if (PHP_CodeSniffer_VERBOSITY > 1) {
314
-                    if ($inStyleDef === true) {
315
-                        echo "\t\t* style definition closed *".PHP_EOL;
316
-                    }
317
-
318
-                    if ($asperandStart === true) {
319
-                        echo "\t\t* at-rule definition closed *".PHP_EOL;
320
-                    }
321
-                }
322
-
323
-                $inStyleDef    = false;
324
-                $asperandStart = false;
325
-                break;
326
-            case T_MINUS:
327
-                // Minus signs are often used instead of spaces inside
328
-                // class names, IDs and styles.
329
-                if ($finalTokens[($stackPtr + 1)]['code'] === T_STRING) {
330
-                    if ($finalTokens[($stackPtr - 1)]['code'] === T_STRING) {
331
-                        $newContent = $finalTokens[($stackPtr - 1)]['content'].'-'.$finalTokens[($stackPtr + 1)]['content'];
332
-
325
+                    break;
326
+                case T_MINUS:
327
+                    // Minus signs are often used instead of spaces inside
328
+                    // class names, IDs and styles.
329
+                    if ($finalTokens[($stackPtr + 1)]['code'] === T_STRING) {
330
+                        if ($finalTokens[($stackPtr - 1)]['code'] === T_STRING) {
331
+                            $newContent = $finalTokens[($stackPtr - 1)]['content'].'-'.$finalTokens[($stackPtr + 1)]['content'];
332
+
333
+                            if (PHP_CodeSniffer_VERBOSITY > 1) {
334
+                                echo "\t\t* token is a string joiner; ignoring this and previous token".PHP_EOL;
335
+                                $old = Util\Common::prepareForOutput($finalTokens[($stackPtr + 1)]['content']);
336
+                                $new = Util\Common::prepareForOutput($newContent);
337
+                                echo "\t\t=> token ".($stackPtr + 1)." content changed from \"$old\" to \"$new\"".PHP_EOL;
338
+                            }
339
+
340
+                            $finalTokens[($stackPtr + 1)]['content'] = $newContent;
341
+                            unset($finalTokens[$stackPtr]);
342
+                            unset($finalTokens[($stackPtr - 1)]);
343
+                        } else {
344
+                            $newContent = '-'.$finalTokens[($stackPtr + 1)]['content'];
345
+
346
+                            $finalTokens[($stackPtr + 1)]['content'] = $newContent;
347
+                            unset($finalTokens[$stackPtr]);
348
+                        }
349
+                    } else if ($finalTokens[($stackPtr + 1)]['code'] === T_LNUMBER) {
350
+                        // They can also be used to provide negative numbers.
333 351
                         if (PHP_CodeSniffer_VERBOSITY > 1) {
334
-                            echo "\t\t* token is a string joiner; ignoring this and previous token".PHP_EOL;
335
-                            $old = Util\Common::prepareForOutput($finalTokens[($stackPtr + 1)]['content']);
336
-                            $new = Util\Common::prepareForOutput($newContent);
337
-                            echo "\t\t=> token ".($stackPtr + 1)." content changed from \"$old\" to \"$new\"".PHP_EOL;
352
+                            echo "\t\t* token is part of a negative number; adding content to next token and ignoring *".PHP_EOL;
353
+                            $content = Util\Common::prepareForOutput($finalTokens[($stackPtr + 1)]['content']);
354
+                            echo "\t\t=> token ".($stackPtr + 1)." content changed from \"$content\" to \"-$content\"".PHP_EOL;
338 355
                         }
339 356
 
340
-                        $finalTokens[($stackPtr + 1)]['content'] = $newContent;
357
+                        $finalTokens[($stackPtr + 1)]['content'] = '-'.$finalTokens[($stackPtr + 1)]['content'];
341 358
                         unset($finalTokens[$stackPtr]);
342
-                        unset($finalTokens[($stackPtr - 1)]);
343
-                    } else {
344
-                        $newContent = '-'.$finalTokens[($stackPtr + 1)]['content'];
359
+                    }//end if
345 360
 
346
-                        $finalTokens[($stackPtr + 1)]['content'] = $newContent;
347
-                        unset($finalTokens[$stackPtr]);
348
-                    }
349
-                } else if ($finalTokens[($stackPtr + 1)]['code'] === T_LNUMBER) {
350
-                    // They can also be used to provide negative numbers.
351
-                    if (PHP_CodeSniffer_VERBOSITY > 1) {
352
-                        echo "\t\t* token is part of a negative number; adding content to next token and ignoring *".PHP_EOL;
353
-                        $content = Util\Common::prepareForOutput($finalTokens[($stackPtr + 1)]['content']);
354
-                        echo "\t\t=> token ".($stackPtr + 1)." content changed from \"$content\" to \"-$content\"".PHP_EOL;
355
-                    }
356
-
357
-                    $finalTokens[($stackPtr + 1)]['content'] = '-'.$finalTokens[($stackPtr + 1)]['content'];
358
-                    unset($finalTokens[$stackPtr]);
359
-                }//end if
360
-
361
-                break;
362
-            case T_COLON:
363
-                // Only interested in colons that are defining styles.
364
-                if ($inStyleDef === false) {
365 361
                     break;
366
-                }
367
-
368
-                for ($x = ($stackPtr - 1); $x >= 0; $x--) {
369
-                    if (isset(Util\Tokens::$emptyTokens[$finalTokens[$x]['code']]) === false) {
362
+                case T_COLON:
363
+                    // Only interested in colons that are defining styles.
364
+                    if ($inStyleDef === false) {
370 365
                         break;
371 366
                     }
372
-                }
373 367
 
374
-                if (PHP_CodeSniffer_VERBOSITY > 1) {
375
-                    $type = $finalTokens[$x]['type'];
376
-                    echo "\t\t=> token $x changed from $type to T_STYLE".PHP_EOL;
377
-                }
378
-
379
-                $finalTokens[$x]['type'] = 'T_STYLE';
380
-                $finalTokens[$x]['code'] = T_STYLE;
381
-                break;
382
-            case T_STRING:
383
-                if (strtolower($token['content']) === 'url') {
384
-                    // Find the next content.
385
-                    for ($x = ($stackPtr + 1); $x < $numTokens; $x++) {
368
+                    for ($x = ($stackPtr - 1); $x >= 0; $x--) {
386 369
                         if (isset(Util\Tokens::$emptyTokens[$finalTokens[$x]['code']]) === false) {
387 370
                             break;
388 371
                         }
389 372
                     }
390 373
 
391
-                    // Needs to be in the format "url(" for it to be a URL.
392
-                    if ($finalTokens[$x]['code'] !== T_OPEN_PARENTHESIS) {
393
-                        continue;
374
+                    if (PHP_CodeSniffer_VERBOSITY > 1) {
375
+                        $type = $finalTokens[$x]['type'];
376
+                        echo "\t\t=> token $x changed from $type to T_STYLE".PHP_EOL;
394 377
                     }
395 378
 
396
-                    // Make sure the content isn't empty.
397
-                    for ($y = ($x + 1); $y < $numTokens; $y++) {
398
-                        if (isset(Util\Tokens::$emptyTokens[$finalTokens[$y]['code']]) === false) {
399
-                            break;
379
+                    $finalTokens[$x]['type'] = 'T_STYLE';
380
+                    $finalTokens[$x]['code'] = T_STYLE;
381
+                    break;
382
+                case T_STRING:
383
+                    if (strtolower($token['content']) === 'url') {
384
+                        // Find the next content.
385
+                        for ($x = ($stackPtr + 1); $x < $numTokens; $x++) {
386
+                            if (isset(Util\Tokens::$emptyTokens[$finalTokens[$x]['code']]) === false) {
387
+                                break;
388
+                            }
400 389
                         }
401
-                    }
402 390
 
403
-                    if ($finalTokens[$y]['code'] === T_CLOSE_PARENTHESIS) {
404
-                        continue;
405
-                    }
406
-
407
-                    if (PHP_CodeSniffer_VERBOSITY > 1) {
408
-                        for ($i = ($stackPtr + 1); $i <= $y; $i++) {
409
-                            $type    = $finalTokens[$i]['type'];
410
-                            $content = Util\Common::prepareForOutput($finalTokens[$i]['content']);
411
-                            echo "\tProcess token $i: $type => $content".PHP_EOL;
391
+                        // Needs to be in the format "url(" for it to be a URL.
392
+                        if ($finalTokens[$x]['code'] !== T_OPEN_PARENTHESIS) {
393
+                            continue;
412 394
                         }
413 395
 
414
-                        echo "\t\t* token starts a URL *".PHP_EOL;
415
-                    }
396
+                        // Make sure the content isn't empty.
397
+                        for ($y = ($x + 1); $y < $numTokens; $y++) {
398
+                            if (isset(Util\Tokens::$emptyTokens[$finalTokens[$y]['code']]) === false) {
399
+                                break;
400
+                            }
401
+                        }
416 402
 
417
-                    // Join all the content together inside the url() statement.
418
-                    $newContent = '';
419
-                    for ($i = ($x + 2); $i < $numTokens; $i++) {
420
-                        if ($finalTokens[$i]['code'] === T_CLOSE_PARENTHESIS) {
421
-                            break;
403
+                        if ($finalTokens[$y]['code'] === T_CLOSE_PARENTHESIS) {
404
+                            continue;
422 405
                         }
423 406
 
424
-                        $newContent .= $finalTokens[$i]['content'];
425 407
                         if (PHP_CodeSniffer_VERBOSITY > 1) {
426
-                            $content = Util\Common::prepareForOutput($finalTokens[$i]['content']);
427
-                            echo "\t\t=> token $i added to URL string and ignored: $content".PHP_EOL;
408
+                            for ($i = ($stackPtr + 1); $i <= $y; $i++) {
409
+                                $type    = $finalTokens[$i]['type'];
410
+                                $content = Util\Common::prepareForOutput($finalTokens[$i]['content']);
411
+                                echo "\tProcess token $i: $type => $content".PHP_EOL;
412
+                            }
413
+
414
+                            echo "\t\t* token starts a URL *".PHP_EOL;
428 415
                         }
429 416
 
430
-                        unset($finalTokens[$i]);
431
-                    }
417
+                        // Join all the content together inside the url() statement.
418
+                        $newContent = '';
419
+                        for ($i = ($x + 2); $i < $numTokens; $i++) {
420
+                            if ($finalTokens[$i]['code'] === T_CLOSE_PARENTHESIS) {
421
+                                break;
422
+                            }
432 423
 
433
-                    $stackPtr = $i;
424
+                            $newContent .= $finalTokens[$i]['content'];
425
+                            if (PHP_CodeSniffer_VERBOSITY > 1) {
426
+                                $content = Util\Common::prepareForOutput($finalTokens[$i]['content']);
427
+                                echo "\t\t=> token $i added to URL string and ignored: $content".PHP_EOL;
428
+                            }
434 429
 
435
-                    // If the content inside the "url()" is in double quotes
436
-                    // there will only be one token and so we don't have to do
437
-                    // anything except change its type. If it is not empty,
438
-                    // we need to do some token merging.
439
-                    $finalTokens[($x + 1)]['type'] = 'T_URL';
440
-                    $finalTokens[($x + 1)]['code'] = T_URL;
430
+                            unset($finalTokens[$i]);
431
+                        }
441 432
 
442
-                    if ($newContent !== '') {
443
-                        $finalTokens[($x + 1)]['content'] .= $newContent;
444
-                        if (PHP_CodeSniffer_VERBOSITY > 1) {
445
-                            $content = Util\Common::prepareForOutput($finalTokens[($x + 1)]['content']);
446
-                            echo "\t\t=> token content changed to: $content".PHP_EOL;
433
+                        $stackPtr = $i;
434
+
435
+                        // If the content inside the "url()" is in double quotes
436
+                        // there will only be one token and so we don't have to do
437
+                        // anything except change its type. If it is not empty,
438
+                        // we need to do some token merging.
439
+                        $finalTokens[($x + 1)]['type'] = 'T_URL';
440
+                        $finalTokens[($x + 1)]['code'] = T_URL;
441
+
442
+                        if ($newContent !== '') {
443
+                            $finalTokens[($x + 1)]['content'] .= $newContent;
444
+                            if (PHP_CodeSniffer_VERBOSITY > 1) {
445
+                                $content = Util\Common::prepareForOutput($finalTokens[($x + 1)]['content']);
446
+                                echo "\t\t=> token content changed to: $content".PHP_EOL;
447
+                            }
447 448
                         }
448
-                    }
449
-                }//end if
449
+                    }//end if
450 450
 
451
-                break;
452
-            case T_ASPERAND:
453
-                $asperandStart = true;
454
-                if (PHP_CodeSniffer_VERBOSITY > 1) {
455
-                    echo "\t\t* at-rule definition opened *".PHP_EOL;
456
-                }
457
-                break;
458
-            default:
459
-                // Nothing special to be done with this token.
460
-                break;
451
+                    break;
452
+                case T_ASPERAND:
453
+                    $asperandStart = true;
454
+                    if (PHP_CodeSniffer_VERBOSITY > 1) {
455
+                        echo "\t\t* at-rule definition opened *".PHP_EOL;
456
+                    }
457
+                    break;
458
+                default:
459
+                    // Nothing special to be done with this token.
460
+                    break;
461 461
             }//end switch
462 462
         }//end for
463 463
 
Please login to merge, or discard this patch.
src/Reports/VersionControl.php 3 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -58,8 +58,8 @@  discard block
 block discarded – undo
58 58
             if (isset($authorCache[$author]) === false) {
59 59
                 $authorCache[$author] = 0;
60 60
                 $praiseCache[$author] = array(
61
-                                         'good' => 0,
62
-                                         'bad'  => 0,
61
+                                            'good' => 0,
62
+                                            'bad'  => 0,
63 63
                                         );
64 64
             }
65 65
 
@@ -99,8 +99,8 @@  discard block
 block discarded – undo
99 99
 
100 100
                 $authorCache[$author] = 0;
101 101
                 $praiseCache[$author] = array(
102
-                                         'good' => 0,
103
-                                         'bad'  => 0,
102
+                                            'good' => 0,
103
+                                            'bad'  => 0,
104 104
                                         );
105 105
             }
106 106
 
@@ -183,9 +183,9 @@  discard block
 block discarded – undo
183 183
             case 'PRAISE':
184 184
                 if (isset($praiseCache[$parts[1]]) === false) {
185 185
                     $praiseCache[$parts[1]] = array(
186
-                                               'good' => $parts[2],
187
-                                               'bad'  => $parts[3],
188
-                                              );
186
+                                                'good' => $parts[2],
187
+                                                'bad'  => $parts[3],
188
+                                                );
189 189
                 } else {
190 190
                     $praiseCache[$parts[1]]['good'] += $parts[2];
191 191
                     $praiseCache[$parts[1]]['bad']  += $parts[3];
Please login to merge, or discard this patch.
Switch Indentation   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -173,37 +173,37 @@
 block discarded – undo
173 173
         foreach ($lines as $line) {
174 174
             $parts = explode('>>', $line);
175 175
             switch ($parts[0]) {
176
-            case 'AUTHOR':
177
-                if (isset($authorCache[$parts[1]]) === false) {
178
-                    $authorCache[$parts[1]] = $parts[2];
179
-                } else {
180
-                    $authorCache[$parts[1]] += $parts[2];
181
-                }
182
-                break;
183
-            case 'PRAISE':
184
-                if (isset($praiseCache[$parts[1]]) === false) {
185
-                    $praiseCache[$parts[1]] = array(
186
-                                               'good' => $parts[2],
187
-                                               'bad'  => $parts[3],
188
-                                              );
189
-                } else {
190
-                    $praiseCache[$parts[1]]['good'] += $parts[2];
191
-                    $praiseCache[$parts[1]]['bad']  += $parts[3];
192
-                }
193
-                break;
194
-            case 'SOURCE':
195
-                if (isset($praiseCache[$parts[1]]) === false) {
196
-                    $praiseCache[$parts[1]] = array();
197
-                }
176
+                case 'AUTHOR':
177
+                    if (isset($authorCache[$parts[1]]) === false) {
178
+                        $authorCache[$parts[1]] = $parts[2];
179
+                    } else {
180
+                        $authorCache[$parts[1]] += $parts[2];
181
+                    }
182
+                    break;
183
+                case 'PRAISE':
184
+                    if (isset($praiseCache[$parts[1]]) === false) {
185
+                        $praiseCache[$parts[1]] = array(
186
+                                                   'good' => $parts[2],
187
+                                                   'bad'  => $parts[3],
188
+                                                  );
189
+                    } else {
190
+                        $praiseCache[$parts[1]]['good'] += $parts[2];
191
+                        $praiseCache[$parts[1]]['bad']  += $parts[3];
192
+                    }
193
+                    break;
194
+                case 'SOURCE':
195
+                    if (isset($praiseCache[$parts[1]]) === false) {
196
+                        $praiseCache[$parts[1]] = array();
197
+                    }
198 198
 
199
-                if (isset($sourceCache[$parts[1]][$parts[2]]) === false) {
200
-                    $sourceCache[$parts[1]][$parts[2]] = $parts[3];
201
-                } else {
202
-                    $sourceCache[$parts[1]][$parts[2]] += $parts[3];
203
-                }
204
-                break;
205
-            default:
206
-                break;
199
+                    if (isset($sourceCache[$parts[1]][$parts[2]]) === false) {
200
+                        $sourceCache[$parts[1]][$parts[2]] = $parts[3];
201
+                    } else {
202
+                        $sourceCache[$parts[1]][$parts[2]] += $parts[3];
203
+                    }
204
+                    break;
205
+                default:
206
+                    break;
207 207
             }//end switch
208 208
         }//end foreach
209 209
 
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
      *
31 31
      * @return bool
32 32
      */
33
-    public function generateFileReport($report, File $phpcsFile, $showSources=false, $width=80)
33
+    public function generateFileReport($report, File $phpcsFile, $showSources = false, $width = 80)
34 34
     {
35 35
         if ($report['errors'] === 0 && $report['warnings'] === 0) {
36 36
             // Nothing to print.
@@ -333,10 +333,10 @@  discard block
 block discarded – undo
333 333
         $totalErrors,
334 334
         $totalWarnings,
335 335
         $totalFixable,
336
-        $showSources=false,
337
-        $width=80,
338
-        $interactive=false,
339
-        $toScreen=true
336
+        $showSources = false,
337
+        $width = 80,
338
+        $interactive = false,
339
+        $toScreen = true
340 340
     ) {
341 341
         if ($cachedData === '') {
342 342
             return;
Please login to merge, or discard this patch.
src/Reports/Source.php 3 patches
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -44,9 +44,9 @@  discard block
 block discarded – undo
44 44
                 foreach ($colErrors as $error) {
45 45
                     if (isset($sources[$error['source']]) === false) {
46 46
                         $sources[$error['source']] = array(
47
-                                                      'fixable' => (int) $error['fixable'],
48
-                                                      'count'   => 1,
49
-                                                     );
47
+                                                        'fixable' => (int) $error['fixable'],
48
+                                                        'count'   => 1,
49
+                                                        );
50 50
                     } else {
51 51
                         $sources[$error['source']]['count']++;
52 52
                     }
@@ -133,9 +133,9 @@  discard block
 block discarded – undo
133 133
                 $maxLength = max($maxLength, $sniff);
134 134
 
135 135
                 $sources[$source] = array(
136
-                                     'count'   => 1,
137
-                                     'fixable' => $fixable,
138
-                                     'parts'   => $parts,
136
+                                        'count'   => 1,
137
+                                        'fixable' => $fixable,
138
+                                        'parts'   => $parts,
139 139
                                     );
140 140
             } else {
141 141
                 $sources[$source]['count']++;
@@ -143,10 +143,10 @@  discard block
 block discarded – undo
143 143
 
144 144
             $fileLen = strlen($parts[0]);
145 145
             $reportFiles[$parts[0]] = array(
146
-                                       'errors'   => $parts[1],
147
-                                       'warnings' => $parts[2],
148
-                                       'strlen'   => $fileLen,
149
-                                      );
146
+                                        'errors'   => $parts[1],
147
+                                        'warnings' => $parts[2],
148
+                                        'strlen'   => $fileLen,
149
+                                        );
150 150
         }//end foreach
151 151
 
152 152
         if ($showSources === true) {
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
      *
31 31
      * @return bool
32 32
      */
33
-    public function generateFileReport($report, File $phpcsFile, $showSources=false, $width=80)
33
+    public function generateFileReport($report, File $phpcsFile, $showSources = false, $width = 80)
34 34
     {
35 35
         if ($report['errors'] === 0 && $report['warnings'] === 0) {
36 36
             // Nothing to print.
@@ -333,10 +333,10 @@  discard block
 block discarded – undo
333 333
         $totalErrors,
334 334
         $totalWarnings,
335 335
         $totalFixable,
336
-        $showSources=false,
337
-        $width=80,
338
-        $interactive=false,
339
-        $toScreen=true
336
+        $showSources = false,
337
+        $width = 80,
338
+        $interactive = false,
339
+        $toScreen = true
340 340
     ) {
341 341
         if ($cachedData === '') {
342 342
             return;
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
      * its data should be counted in the grand totals.
25 25
      *
26 26
      * @param array                 $report      Prepared report data.
27
-     * @param \Symplify\PHP7_CodeSniffer\File $phpcsFile   The file being reported on.
27
+     * @param File $phpcsFile   The file being reported on.
28 28
      * @param bool                  $showSources Show sources?
29 29
      * @param int                   $width       Maximum allowed line width.
30 30
      *
Please login to merge, or discard this patch.
src/Reports/Summary.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -87,10 +87,10 @@
 block discarded – undo
87 87
             $parts   = explode('>>', $line);
88 88
             $fileLen = strlen($parts[0]);
89 89
             $reportFiles[$parts[0]] = array(
90
-                                       'errors'   => $parts[1],
91
-                                       'warnings' => $parts[2],
92
-                                       'strlen'   => $fileLen,
93
-                                      );
90
+                                        'errors'   => $parts[1],
91
+                                        'warnings' => $parts[2],
92
+                                        'strlen'   => $fileLen,
93
+                                        );
94 94
 
95 95
             $maxLength = max($maxLength, $fileLen);
96 96
         }
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
      *
31 31
      * @return bool
32 32
      */
33
-    public function generateFileReport($report, File $phpcsFile, $showSources=false, $width=80)
33
+    public function generateFileReport($report, File $phpcsFile, $showSources = false, $width = 80)
34 34
     {
35 35
         if ($report['errors'] === 0 && $report['warnings'] === 0) {
36 36
             // Nothing to print.
@@ -333,10 +333,10 @@  discard block
 block discarded – undo
333 333
         $totalErrors,
334 334
         $totalWarnings,
335 335
         $totalFixable,
336
-        $showSources=false,
337
-        $width=80,
338
-        $interactive=false,
339
-        $toScreen=true
336
+        $showSources = false,
337
+        $width = 80,
338
+        $interactive = false,
339
+        $toScreen = true
340 340
     ) {
341 341
         if ($cachedData === '') {
342 342
             return;
Please login to merge, or discard this patch.
src/Reports/Report.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
      *
30 30
      * @return bool
31 31
      */
32
-    public function generateFileReport($report, File $phpcsFile, $showSources=false, $width=80);
32
+    public function generateFileReport($report, File $phpcsFile, $showSources = false, $width = 80);
33 33
 
34 34
 
35 35
     /**
@@ -54,10 +54,10 @@  discard block
 block discarded – undo
54 54
         $totalErrors,
55 55
         $totalWarnings,
56 56
         $totalFixable,
57
-        $showSources=false,
58
-        $width=80,
59
-        $interactive=false,
60
-        $toScreen=true
57
+        $showSources = false,
58
+        $width = 80,
59
+        $interactive = false,
60
+        $toScreen = true
61 61
     );
62 62
 
63 63
 
Please login to merge, or discard this patch.
src/Reports/Code.php 3 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -79,9 +79,9 @@
 block discarded – undo
79 79
 
80 80
                 $lastLine++;
81 81
                 $lineTokens[$lastLine] = array(
82
-                                          'start' => $stackPtr,
83
-                                          'end'   => null,
84
-                                         );
82
+                                            'start' => $stackPtr,
83
+                                            'end'   => null,
84
+                                            );
85 85
             }
86 86
         }
87 87
 
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
      *
31 31
      * @return bool
32 32
      */
33
-    public function generateFileReport($report, File $phpcsFile, $showSources=false, $width=80)
33
+    public function generateFileReport($report, File $phpcsFile, $showSources = false, $width = 80)
34 34
     {
35 35
         if ($report['errors'] === 0 && $report['warnings'] === 0) {
36 36
             // Nothing to print.
@@ -333,10 +333,10 @@  discard block
 block discarded – undo
333 333
         $totalErrors,
334 334
         $totalWarnings,
335 335
         $totalFixable,
336
-        $showSources=false,
337
-        $width=80,
338
-        $interactive=false,
339
-        $toScreen=true
336
+        $showSources = false,
337
+        $width = 80,
338
+        $interactive = false,
339
+        $toScreen = true
340 340
     ) {
341 341
         if ($cachedData === '') {
342 342
             return;
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
      * its data should be counted in the grand totals.
25 25
      *
26 26
      * @param array                 $report      Prepared report data.
27
-     * @param \Symplify\PHP7_CodeSniffer\File $phpcsFile   The file being reported on.
27
+     * @param File $phpcsFile   The file being reported on.
28 28
      * @param bool                  $showSources Show sources?
29 29
      * @param int                   $width       Maximum allowed line width.
30 30
      *
Please login to merge, or discard this patch.
src/Reports/Diff.php 3 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
      *
31 31
      * @return bool
32 32
      */
33
-    public function generateFileReport($report, File $phpcsFile, $showSources=false, $width=80)
33
+    public function generateFileReport($report, File $phpcsFile, $showSources = false, $width = 80)
34 34
     {
35 35
         if ($report['errors'] === 0 && $report['warnings'] === 0) {
36 36
             // Nothing to print.
@@ -333,10 +333,10 @@  discard block
 block discarded – undo
333 333
         $totalErrors,
334 334
         $totalWarnings,
335 335
         $totalFixable,
336
-        $showSources=false,
337
-        $width=80,
338
-        $interactive=false,
339
-        $toScreen=true
336
+        $showSources = false,
337
+        $width = 80,
338
+        $interactive = false,
339
+        $toScreen = true
340 340
     ) {
341 341
         if ($cachedData === '') {
342 342
             return;
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,6 @@
 block discarded – undo
10 10
 namespace Symplify\PHP7_CodeSniffer\Reports;
11 11
 
12 12
 use Symplify\PHP7_CodeSniffer\Files\File;
13
-use Symplify\PHP7_CodeSniffer\Util;
14 13
 
15 14
 class Diff implements Report
16 15
 {
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
      * its data should be counted in the grand totals.
25 25
      *
26 26
      * @param array                 $report      Prepared report data.
27
-     * @param \Symplify\PHP7_CodeSniffer\File $phpcsFile   The file being reported on.
27
+     * @param File $phpcsFile   The file being reported on.
28 28
      * @param bool                  $showSources Show sources?
29 29
      * @param int                   $width       Maximum allowed line width.
30 30
      *
Please login to merge, or discard this patch.
src/Reports/Csv.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
      *
31 31
      * @return bool
32 32
      */
33
-    public function generateFileReport($report, File $phpcsFile, $showSources=false, $width=80)
33
+    public function generateFileReport($report, File $phpcsFile, $showSources = false, $width = 80)
34 34
     {
35 35
         if ($report['errors'] === 0 && $report['warnings'] === 0) {
36 36
             // Nothing to print.
@@ -333,10 +333,10 @@  discard block
 block discarded – undo
333 333
         $totalErrors,
334 334
         $totalWarnings,
335 335
         $totalFixable,
336
-        $showSources=false,
337
-        $width=80,
338
-        $interactive=false,
339
-        $toScreen=true
336
+        $showSources = false,
337
+        $width = 80,
338
+        $interactive = false,
339
+        $toScreen = true
340 340
     ) {
341 341
         if ($cachedData === '') {
342 342
             return;
Please login to merge, or discard this patch.