Passed
Pull Request — master (#5)
by
unknown
08:17
created
vendor/squizlabs/php_codesniffer/src/Fixer.php 1 patch
Switch Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -269,14 +269,14 @@
 block discarded – undo
269 269
         foreach ($diffLines as $line) {
270 270
             if (isset($line[0]) === true) {
271 271
                 switch ($line[0]) {
272
-                case '-':
273
-                    $diff[] = "\033[31m$line\033[0m";
274
-                    break;
275
-                case '+':
276
-                    $diff[] = "\033[32m$line\033[0m";
277
-                    break;
278
-                default:
279
-                    $diff[] = $line;
272
+                    case '-':
273
+                        $diff[] = "\033[31m$line\033[0m";
274
+                        break;
275
+                    case '+':
276
+                        $diff[] = "\033[32m$line\033[0m";
277
+                        break;
278
+                    default:
279
+                        $diff[] = $line;
280 280
                 }
281 281
             }
282 282
         }
Please login to merge, or discard this patch.
vendor/squizlabs/php_codesniffer/src/Runner.php 1 patch
Switch Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -677,19 +677,19 @@
 block discarded – undo
677 677
                 $input = trim($input);
678 678
 
679 679
                 switch ($input) {
680
-                case 's':
681
-                    break(2);
682
-                case 'q':
683
-                    throw new DeepExitException('', 0);
684
-                default:
685
-                    // Repopulate the sniffs because some of them save their state
686
-                    // and only clear it when the file changes, but we are rechecking
687
-                    // the same file.
688
-                    $file->ruleset->populateTokenListeners();
689
-                    $file->reloadContent();
690
-                    $file->process();
691
-                    $this->reporter->cacheFileReport($file, $this->config);
692
-                    break;
680
+                    case 's':
681
+                        break(2);
682
+                    case 'q':
683
+                        throw new DeepExitException('', 0);
684
+                    default:
685
+                        // Repopulate the sniffs because some of them save their state
686
+                        // and only clear it when the file changes, but we are rechecking
687
+                        // the same file.
688
+                        $file->ruleset->populateTokenListeners();
689
+                        $file->reloadContent();
690
+                        $file->process();
691
+                        $this->reporter->cacheFileReport($file, $this->config);
692
+                        break;
693 693
                 }
694 694
             }//end while
695 695
         }//end if
Please login to merge, or discard this patch.
vendor/squizlabs/php_codesniffer/src/Reports/VersionControl.php 1 patch
Switch Indentation   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -178,40 +178,40 @@
 block discarded – undo
178 178
         foreach ($lines as $line) {
179 179
             $parts = explode('>>', $line);
180 180
             switch ($parts[0]) {
181
-            case 'AUTHOR':
182
-                if (isset($authorCache[$parts[1]]) === false) {
183
-                    $authorCache[$parts[1]] = $parts[2];
184
-                } else {
185
-                    $authorCache[$parts[1]] += $parts[2];
186
-                }
187
-                break;
188
-            case 'PRAISE':
189
-                if (isset($praiseCache[$parts[1]]) === false) {
190
-                    $praiseCache[$parts[1]] = [
191
-                        'good' => $parts[2],
192
-                        'bad'  => $parts[3],
193
-                    ];
194
-                } else {
195
-                    $praiseCache[$parts[1]]['good'] += $parts[2];
196
-                    $praiseCache[$parts[1]]['bad']  += $parts[3];
197
-                }
198
-                break;
199
-            case 'SOURCE':
200
-                if (isset($praiseCache[$parts[1]]) === false) {
201
-                    $praiseCache[$parts[1]] = [];
202
-                }
181
+                case 'AUTHOR':
182
+                    if (isset($authorCache[$parts[1]]) === false) {
183
+                        $authorCache[$parts[1]] = $parts[2];
184
+                    } else {
185
+                        $authorCache[$parts[1]] += $parts[2];
186
+                    }
187
+                    break;
188
+                case 'PRAISE':
189
+                    if (isset($praiseCache[$parts[1]]) === false) {
190
+                        $praiseCache[$parts[1]] = [
191
+                            'good' => $parts[2],
192
+                            'bad'  => $parts[3],
193
+                        ];
194
+                    } else {
195
+                        $praiseCache[$parts[1]]['good'] += $parts[2];
196
+                        $praiseCache[$parts[1]]['bad']  += $parts[3];
197
+                    }
198
+                    break;
199
+                case 'SOURCE':
200
+                    if (isset($praiseCache[$parts[1]]) === false) {
201
+                        $praiseCache[$parts[1]] = [];
202
+                    }
203 203
 
204
-                if (isset($sourceCache[$parts[1]][$parts[2]]) === false) {
205
-                    $sourceCache[$parts[1]][$parts[2]] = [
206
-                        'count'   => $parts[3],
207
-                        'fixable' => (bool) $parts[4],
208
-                    ];
209
-                } else {
210
-                    $sourceCache[$parts[1]][$parts[2]]['count'] += $parts[3];
211
-                }
212
-                break;
213
-            default:
214
-                break;
204
+                    if (isset($sourceCache[$parts[1]][$parts[2]]) === false) {
205
+                        $sourceCache[$parts[1]][$parts[2]] = [
206
+                            'count'   => $parts[3],
207
+                            'fixable' => (bool) $parts[4],
208
+                        ];
209
+                    } else {
210
+                        $sourceCache[$parts[1]][$parts[2]]['count'] += $parts[3];
211
+                    }
212
+                    break;
213
+                default:
214
+                    break;
215 215
             }//end switch
216 216
         }//end foreach
217 217
 
Please login to merge, or discard this patch.
vendor/squizlabs/php_codesniffer/src/Tokenizers/CSS.php 1 patch
Switch Indentation   +152 added lines, -152 removed lines patch added patch discarded remove patch
@@ -289,12 +289,32 @@  discard block
 block discarded – undo
289 289
             }
290 290
 
291 291
             switch ($token['code']) {
292
-            case T_OPEN_CURLY_BRACKET:
293
-                // Opening curly brackets for an At-rule do not start a style
294
-                // definition. We also reset the asperand flag here because the next
295
-                // opening curly bracket could be indeed the start of a style
296
-                // definition.
297
-                if ($asperandStart === true) {
292
+                case T_OPEN_CURLY_BRACKET:
293
+                    // Opening curly brackets for an At-rule do not start a style
294
+                    // definition. We also reset the asperand flag here because the next
295
+                    // opening curly bracket could be indeed the start of a style
296
+                    // definition.
297
+                    if ($asperandStart === true) {
298
+                        if (PHP_CODESNIFFER_VERBOSITY > 1) {
299
+                            if ($inStyleDef === true) {
300
+                                echo "\t\t* style definition closed *".PHP_EOL;
301
+                            }
302
+
303
+                            if ($asperandStart === true) {
304
+                                echo "\t\t* at-rule definition closed *".PHP_EOL;
305
+                            }
306
+                        }
307
+
308
+                        $inStyleDef    = false;
309
+                        $asperandStart = false;
310
+                    } else {
311
+                        $inStyleDef = true;
312
+                        if (PHP_CODESNIFFER_VERBOSITY > 1) {
313
+                            echo "\t\t* style definition opened *".PHP_EOL;
314
+                        }
315
+                    }
316
+                    break;
317
+                case T_CLOSE_CURLY_BRACKET:
298 318
                     if (PHP_CODESNIFFER_VERBOSITY > 1) {
299 319
                         if ($inStyleDef === true) {
300 320
                             echo "\t\t* style definition closed *".PHP_EOL;
@@ -307,184 +327,164 @@  discard block
 block discarded – undo
307 327
 
308 328
                     $inStyleDef    = false;
309 329
                     $asperandStart = false;
310
-                } else {
311
-                    $inStyleDef = true;
312
-                    if (PHP_CODESNIFFER_VERBOSITY > 1) {
313
-                        echo "\t\t* style definition opened *".PHP_EOL;
314
-                    }
315
-                }
316
-                break;
317
-            case T_CLOSE_CURLY_BRACKET:
318
-                if (PHP_CODESNIFFER_VERBOSITY > 1) {
319
-                    if ($inStyleDef === true) {
320
-                        echo "\t\t* style definition closed *".PHP_EOL;
321
-                    }
322
-
323
-                    if ($asperandStart === true) {
324
-                        echo "\t\t* at-rule definition closed *".PHP_EOL;
325
-                    }
326
-                }
327
-
328
-                $inStyleDef    = false;
329
-                $asperandStart = false;
330
-                break;
331
-            case T_MINUS:
332
-                // Minus signs are often used instead of spaces inside
333
-                // class names, IDs and styles.
334
-                if ($finalTokens[($stackPtr + 1)]['code'] === T_STRING) {
335
-                    if ($finalTokens[($stackPtr - 1)]['code'] === T_STRING) {
336
-                        $newContent = $finalTokens[($stackPtr - 1)]['content'].'-'.$finalTokens[($stackPtr + 1)]['content'];
337
-
330
+                    break;
331
+                case T_MINUS:
332
+                    // Minus signs are often used instead of spaces inside
333
+                    // class names, IDs and styles.
334
+                    if ($finalTokens[($stackPtr + 1)]['code'] === T_STRING) {
335
+                        if ($finalTokens[($stackPtr - 1)]['code'] === T_STRING) {
336
+                            $newContent = $finalTokens[($stackPtr - 1)]['content'].'-'.$finalTokens[($stackPtr + 1)]['content'];
337
+
338
+                            if (PHP_CODESNIFFER_VERBOSITY > 1) {
339
+                                echo "\t\t* token is a string joiner; ignoring this and previous token".PHP_EOL;
340
+                                $old = Util\Common::prepareForOutput($finalTokens[($stackPtr + 1)]['content']);
341
+                                $new = Util\Common::prepareForOutput($newContent);
342
+                                echo "\t\t=> token ".($stackPtr + 1)." content changed from \"$old\" to \"$new\"".PHP_EOL;
343
+                            }
344
+
345
+                            $finalTokens[($stackPtr + 1)]['content'] = $newContent;
346
+                            unset($finalTokens[$stackPtr]);
347
+                            unset($finalTokens[($stackPtr - 1)]);
348
+                        } else {
349
+                            $newContent = '-'.$finalTokens[($stackPtr + 1)]['content'];
350
+
351
+                            $finalTokens[($stackPtr + 1)]['content'] = $newContent;
352
+                            unset($finalTokens[$stackPtr]);
353
+                        }
354
+                    } else if ($finalTokens[($stackPtr + 1)]['code'] === T_LNUMBER) {
355
+                        // They can also be used to provide negative numbers.
338 356
                         if (PHP_CODESNIFFER_VERBOSITY > 1) {
339
-                            echo "\t\t* token is a string joiner; ignoring this and previous token".PHP_EOL;
340
-                            $old = Util\Common::prepareForOutput($finalTokens[($stackPtr + 1)]['content']);
341
-                            $new = Util\Common::prepareForOutput($newContent);
342
-                            echo "\t\t=> token ".($stackPtr + 1)." content changed from \"$old\" to \"$new\"".PHP_EOL;
357
+                            echo "\t\t* token is part of a negative number; adding content to next token and ignoring *".PHP_EOL;
358
+                            $content = Util\Common::prepareForOutput($finalTokens[($stackPtr + 1)]['content']);
359
+                            echo "\t\t=> token ".($stackPtr + 1)." content changed from \"$content\" to \"-$content\"".PHP_EOL;
343 360
                         }
344 361
 
345
-                        $finalTokens[($stackPtr + 1)]['content'] = $newContent;
362
+                        $finalTokens[($stackPtr + 1)]['content'] = '-'.$finalTokens[($stackPtr + 1)]['content'];
346 363
                         unset($finalTokens[$stackPtr]);
347
-                        unset($finalTokens[($stackPtr - 1)]);
348
-                    } else {
349
-                        $newContent = '-'.$finalTokens[($stackPtr + 1)]['content'];
350
-
351
-                        $finalTokens[($stackPtr + 1)]['content'] = $newContent;
352
-                        unset($finalTokens[$stackPtr]);
353
-                    }
354
-                } else if ($finalTokens[($stackPtr + 1)]['code'] === T_LNUMBER) {
355
-                    // They can also be used to provide negative numbers.
356
-                    if (PHP_CODESNIFFER_VERBOSITY > 1) {
357
-                        echo "\t\t* token is part of a negative number; adding content to next token and ignoring *".PHP_EOL;
358
-                        $content = Util\Common::prepareForOutput($finalTokens[($stackPtr + 1)]['content']);
359
-                        echo "\t\t=> token ".($stackPtr + 1)." content changed from \"$content\" to \"-$content\"".PHP_EOL;
360
-                    }
361
-
362
-                    $finalTokens[($stackPtr + 1)]['content'] = '-'.$finalTokens[($stackPtr + 1)]['content'];
363
-                    unset($finalTokens[$stackPtr]);
364
-                }//end if
365
-                break;
366
-            case T_COLON:
367
-                // Only interested in colons that are defining styles.
368
-                if ($inStyleDef === false) {
364
+                    }//end if
369 365
                     break;
370
-                }
371
-
372
-                for ($x = ($stackPtr - 1); $x >= 0; $x--) {
373
-                    if (isset(Util\Tokens::$emptyTokens[$finalTokens[$x]['code']]) === false) {
366
+                case T_COLON:
367
+                    // Only interested in colons that are defining styles.
368
+                    if ($inStyleDef === false) {
374 369
                         break;
375 370
                     }
376
-                }
377 371
 
378
-                if (PHP_CODESNIFFER_VERBOSITY > 1) {
379
-                    $type = $finalTokens[$x]['type'];
380
-                    echo "\t\t=> token $x changed from $type to T_STYLE".PHP_EOL;
381
-                }
382
-
383
-                $finalTokens[$x]['type'] = 'T_STYLE';
384
-                $finalTokens[$x]['code'] = T_STYLE;
385
-                break;
386
-            case T_STRING:
387
-                if (strtolower($token['content']) === 'url') {
388
-                    // Find the next content.
389
-                    for ($x = ($stackPtr + 1); $x < $numTokens; $x++) {
372
+                    for ($x = ($stackPtr - 1); $x >= 0; $x--) {
390 373
                         if (isset(Util\Tokens::$emptyTokens[$finalTokens[$x]['code']]) === false) {
391 374
                             break;
392 375
                         }
393 376
                     }
394 377
 
395
-                    // Needs to be in the format "url(" for it to be a URL.
396
-                    if ($finalTokens[$x]['code'] !== T_OPEN_PARENTHESIS) {
397
-                        continue 2;
378
+                    if (PHP_CODESNIFFER_VERBOSITY > 1) {
379
+                        $type = $finalTokens[$x]['type'];
380
+                        echo "\t\t=> token $x changed from $type to T_STYLE".PHP_EOL;
398 381
                     }
399 382
 
400
-                    // Make sure the content isn't empty.
401
-                    for ($y = ($x + 1); $y < $numTokens; $y++) {
402
-                        if (isset(Util\Tokens::$emptyTokens[$finalTokens[$y]['code']]) === false) {
403
-                            break;
383
+                    $finalTokens[$x]['type'] = 'T_STYLE';
384
+                    $finalTokens[$x]['code'] = T_STYLE;
385
+                    break;
386
+                case T_STRING:
387
+                    if (strtolower($token['content']) === 'url') {
388
+                        // Find the next content.
389
+                        for ($x = ($stackPtr + 1); $x < $numTokens; $x++) {
390
+                            if (isset(Util\Tokens::$emptyTokens[$finalTokens[$x]['code']]) === false) {
391
+                                break;
392
+                            }
404 393
                         }
405
-                    }
406 394
 
407
-                    if ($finalTokens[$y]['code'] === T_CLOSE_PARENTHESIS) {
408
-                        continue 2;
409
-                    }
410
-
411
-                    if (PHP_CODESNIFFER_VERBOSITY > 1) {
412
-                        for ($i = ($stackPtr + 1); $i <= $y; $i++) {
413
-                            $type    = $finalTokens[$i]['type'];
414
-                            $content = Util\Common::prepareForOutput($finalTokens[$i]['content']);
415
-                            echo "\tProcess token $i: $type => $content".PHP_EOL;
395
+                        // Needs to be in the format "url(" for it to be a URL.
396
+                        if ($finalTokens[$x]['code'] !== T_OPEN_PARENTHESIS) {
397
+                            continue 2;
416 398
                         }
417 399
 
418
-                        echo "\t\t* token starts a URL *".PHP_EOL;
419
-                    }
400
+                        // Make sure the content isn't empty.
401
+                        for ($y = ($x + 1); $y < $numTokens; $y++) {
402
+                            if (isset(Util\Tokens::$emptyTokens[$finalTokens[$y]['code']]) === false) {
403
+                                break;
404
+                            }
405
+                        }
420 406
 
421
-                    // Join all the content together inside the url() statement.
422
-                    $newContent = '';
423
-                    for ($i = ($x + 2); $i < $numTokens; $i++) {
424
-                        if ($finalTokens[$i]['code'] === T_CLOSE_PARENTHESIS) {
425
-                            break;
407
+                        if ($finalTokens[$y]['code'] === T_CLOSE_PARENTHESIS) {
408
+                            continue 2;
426 409
                         }
427 410
 
428
-                        $newContent .= $finalTokens[$i]['content'];
429 411
                         if (PHP_CODESNIFFER_VERBOSITY > 1) {
430
-                            $content = Util\Common::prepareForOutput($finalTokens[$i]['content']);
431
-                            echo "\t\t=> token $i added to URL string and ignored: $content".PHP_EOL;
412
+                            for ($i = ($stackPtr + 1); $i <= $y; $i++) {
413
+                                $type    = $finalTokens[$i]['type'];
414
+                                $content = Util\Common::prepareForOutput($finalTokens[$i]['content']);
415
+                                echo "\tProcess token $i: $type => $content".PHP_EOL;
416
+                            }
417
+
418
+                            echo "\t\t* token starts a URL *".PHP_EOL;
432 419
                         }
433 420
 
434
-                        unset($finalTokens[$i]);
435
-                    }
421
+                        // Join all the content together inside the url() statement.
422
+                        $newContent = '';
423
+                        for ($i = ($x + 2); $i < $numTokens; $i++) {
424
+                            if ($finalTokens[$i]['code'] === T_CLOSE_PARENTHESIS) {
425
+                                break;
426
+                            }
436 427
 
437
-                    $stackPtr = $i;
428
+                            $newContent .= $finalTokens[$i]['content'];
429
+                            if (PHP_CODESNIFFER_VERBOSITY > 1) {
430
+                                $content = Util\Common::prepareForOutput($finalTokens[$i]['content']);
431
+                                echo "\t\t=> token $i added to URL string and ignored: $content".PHP_EOL;
432
+                            }
438 433
 
439
-                    // If the content inside the "url()" is in double quotes
440
-                    // there will only be one token and so we don't have to do
441
-                    // anything except change its type. If it is not empty,
442
-                    // we need to do some token merging.
443
-                    $finalTokens[($x + 1)]['type'] = 'T_URL';
444
-                    $finalTokens[($x + 1)]['code'] = T_URL;
434
+                            unset($finalTokens[$i]);
435
+                        }
445 436
 
446
-                    if ($newContent !== '') {
447
-                        $finalTokens[($x + 1)]['content'] .= $newContent;
448
-                        if (PHP_CODESNIFFER_VERBOSITY > 1) {
449
-                            $content = Util\Common::prepareForOutput($finalTokens[($x + 1)]['content']);
450
-                            echo "\t\t=> token content changed to: $content".PHP_EOL;
437
+                        $stackPtr = $i;
438
+
439
+                        // If the content inside the "url()" is in double quotes
440
+                        // there will only be one token and so we don't have to do
441
+                        // anything except change its type. If it is not empty,
442
+                        // we need to do some token merging.
443
+                        $finalTokens[($x + 1)]['type'] = 'T_URL';
444
+                        $finalTokens[($x + 1)]['code'] = T_URL;
445
+
446
+                        if ($newContent !== '') {
447
+                            $finalTokens[($x + 1)]['content'] .= $newContent;
448
+                            if (PHP_CODESNIFFER_VERBOSITY > 1) {
449
+                                $content = Util\Common::prepareForOutput($finalTokens[($x + 1)]['content']);
450
+                                echo "\t\t=> token content changed to: $content".PHP_EOL;
451
+                            }
451 452
                         }
452
-                    }
453
-                } else if ($finalTokens[$stackPtr]['content'][0] === '-'
454
-                    && $finalTokens[($stackPtr + 1)]['code'] === T_STRING
455
-                ) {
456
-                    if (isset($finalTokens[($stackPtr - 1)]) === true
457
-                        && $finalTokens[($stackPtr - 1)]['code'] === T_STRING
453
+                    } else if ($finalTokens[$stackPtr]['content'][0] === '-'
454
+                        && $finalTokens[($stackPtr + 1)]['code'] === T_STRING
458 455
                     ) {
459
-                        $newContent = $finalTokens[($stackPtr - 1)]['content'].$finalTokens[$stackPtr]['content'].$finalTokens[($stackPtr + 1)]['content'];
460
-
461
-                        if (PHP_CODESNIFFER_VERBOSITY > 1) {
462
-                            echo "\t\t* token is a string joiner; ignoring this and previous token".PHP_EOL;
463
-                            $old = Util\Common::prepareForOutput($finalTokens[($stackPtr + 1)]['content']);
464
-                            $new = Util\Common::prepareForOutput($newContent);
465
-                            echo "\t\t=> token ".($stackPtr + 1)." content changed from \"$old\" to \"$new\"".PHP_EOL;
456
+                        if (isset($finalTokens[($stackPtr - 1)]) === true
457
+                            && $finalTokens[($stackPtr - 1)]['code'] === T_STRING
458
+                        ) {
459
+                            $newContent = $finalTokens[($stackPtr - 1)]['content'].$finalTokens[$stackPtr]['content'].$finalTokens[($stackPtr + 1)]['content'];
460
+
461
+                            if (PHP_CODESNIFFER_VERBOSITY > 1) {
462
+                                echo "\t\t* token is a string joiner; ignoring this and previous token".PHP_EOL;
463
+                                $old = Util\Common::prepareForOutput($finalTokens[($stackPtr + 1)]['content']);
464
+                                $new = Util\Common::prepareForOutput($newContent);
465
+                                echo "\t\t=> token ".($stackPtr + 1)." content changed from \"$old\" to \"$new\"".PHP_EOL;
466
+                            }
467
+
468
+                            $finalTokens[($stackPtr + 1)]['content'] = $newContent;
469
+                            unset($finalTokens[$stackPtr]);
470
+                            unset($finalTokens[($stackPtr - 1)]);
471
+                        } else {
472
+                            $newContent = $finalTokens[$stackPtr]['content'].$finalTokens[($stackPtr + 1)]['content'];
473
+
474
+                            $finalTokens[($stackPtr + 1)]['content'] = $newContent;
475
+                            unset($finalTokens[$stackPtr]);
466 476
                         }
467
-
468
-                        $finalTokens[($stackPtr + 1)]['content'] = $newContent;
469
-                        unset($finalTokens[$stackPtr]);
470
-                        unset($finalTokens[($stackPtr - 1)]);
471
-                    } else {
472
-                        $newContent = $finalTokens[$stackPtr]['content'].$finalTokens[($stackPtr + 1)]['content'];
473
-
474
-                        $finalTokens[($stackPtr + 1)]['content'] = $newContent;
475
-                        unset($finalTokens[$stackPtr]);
477
+                    }//end if
478
+                    break;
479
+                case T_ASPERAND:
480
+                    $asperandStart = true;
481
+                    if (PHP_CODESNIFFER_VERBOSITY > 1) {
482
+                        echo "\t\t* at-rule definition opened *".PHP_EOL;
476 483
                     }
477
-                }//end if
478
-                break;
479
-            case T_ASPERAND:
480
-                $asperandStart = true;
481
-                if (PHP_CODESNIFFER_VERBOSITY > 1) {
482
-                    echo "\t\t* at-rule definition opened *".PHP_EOL;
483
-                }
484
-                break;
485
-            default:
486
-                // Nothing special to be done with this token.
487
-                break;
484
+                    break;
485
+                default:
486
+                    // Nothing special to be done with this token.
487
+                    break;
488 488
             }//end switch
489 489
         }//end for
490 490
 
Please login to merge, or discard this patch.
vendor/squizlabs/php_codesniffer/src/Tokenizers/Tokenizer.php 1 patch
Switch Indentation   +45 added lines, -45 removed lines patch added patch discarded remove patch
@@ -743,60 +743,60 @@
 block discarded – undo
743 743
             */
744 744
 
745 745
             switch ($this->tokens[$i]['code']) {
746
-            case T_OPEN_SQUARE_BRACKET:
747
-                $squareOpeners[] = $i;
748
-
749
-                if (PHP_CODESNIFFER_VERBOSITY > 1) {
750
-                    echo str_repeat("\t", count($squareOpeners));
751
-                    echo str_repeat("\t", count($curlyOpeners));
752
-                    echo "=> Found square bracket opener at $i".PHP_EOL;
753
-                }
754
-                break;
755
-            case T_OPEN_CURLY_BRACKET:
756
-                if (isset($this->tokens[$i]['scope_closer']) === false) {
757
-                    $curlyOpeners[] = $i;
746
+                case T_OPEN_SQUARE_BRACKET:
747
+                    $squareOpeners[] = $i;
758 748
 
759 749
                     if (PHP_CODESNIFFER_VERBOSITY > 1) {
760 750
                         echo str_repeat("\t", count($squareOpeners));
761 751
                         echo str_repeat("\t", count($curlyOpeners));
762
-                        echo "=> Found curly bracket opener at $i".PHP_EOL;
752
+                        echo "=> Found square bracket opener at $i".PHP_EOL;
763 753
                     }
764
-                }
765
-                break;
766
-            case T_CLOSE_SQUARE_BRACKET:
767
-                if (empty($squareOpeners) === false) {
768
-                    $opener = array_pop($squareOpeners);
769
-                    $this->tokens[$i]['bracket_opener']      = $opener;
770
-                    $this->tokens[$i]['bracket_closer']      = $i;
771
-                    $this->tokens[$opener]['bracket_opener'] = $opener;
772
-                    $this->tokens[$opener]['bracket_closer'] = $i;
754
+                    break;
755
+                case T_OPEN_CURLY_BRACKET:
756
+                    if (isset($this->tokens[$i]['scope_closer']) === false) {
757
+                        $curlyOpeners[] = $i;
773 758
 
774
-                    if (PHP_CODESNIFFER_VERBOSITY > 1) {
775
-                        echo str_repeat("\t", count($squareOpeners));
776
-                        echo str_repeat("\t", count($curlyOpeners));
777
-                        echo "\t=> Found square bracket closer at $i for $opener".PHP_EOL;
759
+                        if (PHP_CODESNIFFER_VERBOSITY > 1) {
760
+                            echo str_repeat("\t", count($squareOpeners));
761
+                            echo str_repeat("\t", count($curlyOpeners));
762
+                            echo "=> Found curly bracket opener at $i".PHP_EOL;
763
+                        }
778 764
                     }
779
-                }
780
-                break;
781
-            case T_CLOSE_CURLY_BRACKET:
782
-                if (empty($curlyOpeners) === false
783
-                    && isset($this->tokens[$i]['scope_opener']) === false
784
-                ) {
785
-                    $opener = array_pop($curlyOpeners);
786
-                    $this->tokens[$i]['bracket_opener']      = $opener;
787
-                    $this->tokens[$i]['bracket_closer']      = $i;
788
-                    $this->tokens[$opener]['bracket_opener'] = $opener;
789
-                    $this->tokens[$opener]['bracket_closer'] = $i;
765
+                    break;
766
+                case T_CLOSE_SQUARE_BRACKET:
767
+                    if (empty($squareOpeners) === false) {
768
+                        $opener = array_pop($squareOpeners);
769
+                        $this->tokens[$i]['bracket_opener']      = $opener;
770
+                        $this->tokens[$i]['bracket_closer']      = $i;
771
+                        $this->tokens[$opener]['bracket_opener'] = $opener;
772
+                        $this->tokens[$opener]['bracket_closer'] = $i;
790 773
 
791
-                    if (PHP_CODESNIFFER_VERBOSITY > 1) {
792
-                        echo str_repeat("\t", count($squareOpeners));
793
-                        echo str_repeat("\t", count($curlyOpeners));
794
-                        echo "\t=> Found curly bracket closer at $i for $opener".PHP_EOL;
774
+                        if (PHP_CODESNIFFER_VERBOSITY > 1) {
775
+                            echo str_repeat("\t", count($squareOpeners));
776
+                            echo str_repeat("\t", count($curlyOpeners));
777
+                            echo "\t=> Found square bracket closer at $i for $opener".PHP_EOL;
778
+                        }
795 779
                     }
796
-                }
797
-                break;
798
-            default:
799
-                continue 2;
780
+                    break;
781
+                case T_CLOSE_CURLY_BRACKET:
782
+                    if (empty($curlyOpeners) === false
783
+                        && isset($this->tokens[$i]['scope_opener']) === false
784
+                    ) {
785
+                        $opener = array_pop($curlyOpeners);
786
+                        $this->tokens[$i]['bracket_opener']      = $opener;
787
+                        $this->tokens[$i]['bracket_closer']      = $i;
788
+                        $this->tokens[$opener]['bracket_opener'] = $opener;
789
+                        $this->tokens[$opener]['bracket_closer'] = $i;
790
+
791
+                        if (PHP_CODESNIFFER_VERBOSITY > 1) {
792
+                            echo str_repeat("\t", count($squareOpeners));
793
+                            echo str_repeat("\t", count($curlyOpeners));
794
+                            echo "\t=> Found curly bracket closer at $i for $opener".PHP_EOL;
795
+                        }
796
+                    }
797
+                    break;
798
+                default:
799
+                    continue 2;
800 800
             }//end switch
801 801
         }//end for
802 802
 
Please login to merge, or discard this patch.
vendor/squizlabs/php_codesniffer/src/Tokenizers/PHP.php 1 patch
Switch Indentation   +99 added lines, -99 removed lines patch added patch discarded remove patch
@@ -2219,24 +2219,24 @@  discard block
 block discarded – undo
2219 2219
 
2220 2220
         if ($token[0] === T_STRING) {
2221 2221
             switch ($cacheKey) {
2222
-            case 'false':
2223
-                $newToken['type'] = 'T_FALSE';
2224
-                break;
2225
-            case 'true':
2226
-                $newToken['type'] = 'T_TRUE';
2227
-                break;
2228
-            case 'null':
2229
-                $newToken['type'] = 'T_NULL';
2230
-                break;
2231
-            case 'self':
2232
-                $newToken['type'] = 'T_SELF';
2233
-                break;
2234
-            case 'parent':
2235
-                $newToken['type'] = 'T_PARENT';
2236
-                break;
2237
-            default:
2238
-                $newToken['type'] = 'T_STRING';
2239
-                break;
2222
+                case 'false':
2223
+                    $newToken['type'] = 'T_FALSE';
2224
+                    break;
2225
+                case 'true':
2226
+                    $newToken['type'] = 'T_TRUE';
2227
+                    break;
2228
+                case 'null':
2229
+                    $newToken['type'] = 'T_NULL';
2230
+                    break;
2231
+                case 'self':
2232
+                    $newToken['type'] = 'T_SELF';
2233
+                    break;
2234
+                case 'parent':
2235
+                    $newToken['type'] = 'T_PARENT';
2236
+                    break;
2237
+                default:
2238
+                    $newToken['type'] = 'T_STRING';
2239
+                    break;
2240 2240
             }
2241 2241
 
2242 2242
             $newToken['code'] = constant($newToken['type']);
@@ -2278,87 +2278,87 @@  discard block
 block discarded – undo
2278 2278
         $newToken = [];
2279 2279
 
2280 2280
         switch ($token) {
2281
-        case '{':
2282
-            $newToken['type'] = 'T_OPEN_CURLY_BRACKET';
2283
-            break;
2284
-        case '}':
2285
-            $newToken['type'] = 'T_CLOSE_CURLY_BRACKET';
2286
-            break;
2287
-        case '[':
2288
-            $newToken['type'] = 'T_OPEN_SQUARE_BRACKET';
2289
-            break;
2290
-        case ']':
2291
-            $newToken['type'] = 'T_CLOSE_SQUARE_BRACKET';
2292
-            break;
2293
-        case '(':
2294
-            $newToken['type'] = 'T_OPEN_PARENTHESIS';
2295
-            break;
2296
-        case ')':
2297
-            $newToken['type'] = 'T_CLOSE_PARENTHESIS';
2298
-            break;
2299
-        case ':':
2300
-            $newToken['type'] = 'T_COLON';
2301
-            break;
2302
-        case '.':
2303
-            $newToken['type'] = 'T_STRING_CONCAT';
2304
-            break;
2305
-        case ';':
2306
-            $newToken['type'] = 'T_SEMICOLON';
2307
-            break;
2308
-        case '=':
2309
-            $newToken['type'] = 'T_EQUAL';
2310
-            break;
2311
-        case '*':
2312
-            $newToken['type'] = 'T_MULTIPLY';
2313
-            break;
2314
-        case '/':
2315
-            $newToken['type'] = 'T_DIVIDE';
2316
-            break;
2317
-        case '+':
2318
-            $newToken['type'] = 'T_PLUS';
2319
-            break;
2320
-        case '-':
2321
-            $newToken['type'] = 'T_MINUS';
2322
-            break;
2323
-        case '%':
2324
-            $newToken['type'] = 'T_MODULUS';
2325
-            break;
2326
-        case '^':
2327
-            $newToken['type'] = 'T_BITWISE_XOR';
2328
-            break;
2329
-        case '&':
2330
-            $newToken['type'] = 'T_BITWISE_AND';
2331
-            break;
2332
-        case '|':
2333
-            $newToken['type'] = 'T_BITWISE_OR';
2334
-            break;
2335
-        case '~':
2336
-            $newToken['type'] = 'T_BITWISE_NOT';
2337
-            break;
2338
-        case '<':
2339
-            $newToken['type'] = 'T_LESS_THAN';
2340
-            break;
2341
-        case '>':
2342
-            $newToken['type'] = 'T_GREATER_THAN';
2343
-            break;
2344
-        case '!':
2345
-            $newToken['type'] = 'T_BOOLEAN_NOT';
2346
-            break;
2347
-        case ',':
2348
-            $newToken['type'] = 'T_COMMA';
2349
-            break;
2350
-        case '@':
2351
-            $newToken['type'] = 'T_ASPERAND';
2352
-            break;
2353
-        case '$':
2354
-            $newToken['type'] = 'T_DOLLAR';
2355
-            break;
2356
-        case '`':
2357
-            $newToken['type'] = 'T_BACKTICK';
2358
-            break;
2359
-        default:
2360
-            $newToken['type'] = 'T_NONE';
2361
-            break;
2281
+            case '{':
2282
+                $newToken['type'] = 'T_OPEN_CURLY_BRACKET';
2283
+                break;
2284
+            case '}':
2285
+                $newToken['type'] = 'T_CLOSE_CURLY_BRACKET';
2286
+                break;
2287
+            case '[':
2288
+                $newToken['type'] = 'T_OPEN_SQUARE_BRACKET';
2289
+                break;
2290
+            case ']':
2291
+                $newToken['type'] = 'T_CLOSE_SQUARE_BRACKET';
2292
+                break;
2293
+            case '(':
2294
+                $newToken['type'] = 'T_OPEN_PARENTHESIS';
2295
+                break;
2296
+            case ')':
2297
+                $newToken['type'] = 'T_CLOSE_PARENTHESIS';
2298
+                break;
2299
+            case ':':
2300
+                $newToken['type'] = 'T_COLON';
2301
+                break;
2302
+            case '.':
2303
+                $newToken['type'] = 'T_STRING_CONCAT';
2304
+                break;
2305
+            case ';':
2306
+                $newToken['type'] = 'T_SEMICOLON';
2307
+                break;
2308
+            case '=':
2309
+                $newToken['type'] = 'T_EQUAL';
2310
+                break;
2311
+            case '*':
2312
+                $newToken['type'] = 'T_MULTIPLY';
2313
+                break;
2314
+            case '/':
2315
+                $newToken['type'] = 'T_DIVIDE';
2316
+                break;
2317
+            case '+':
2318
+                $newToken['type'] = 'T_PLUS';
2319
+                break;
2320
+            case '-':
2321
+                $newToken['type'] = 'T_MINUS';
2322
+                break;
2323
+            case '%':
2324
+                $newToken['type'] = 'T_MODULUS';
2325
+                break;
2326
+            case '^':
2327
+                $newToken['type'] = 'T_BITWISE_XOR';
2328
+                break;
2329
+            case '&':
2330
+                $newToken['type'] = 'T_BITWISE_AND';
2331
+                break;
2332
+            case '|':
2333
+                $newToken['type'] = 'T_BITWISE_OR';
2334
+                break;
2335
+            case '~':
2336
+                $newToken['type'] = 'T_BITWISE_NOT';
2337
+                break;
2338
+            case '<':
2339
+                $newToken['type'] = 'T_LESS_THAN';
2340
+                break;
2341
+            case '>':
2342
+                $newToken['type'] = 'T_GREATER_THAN';
2343
+                break;
2344
+            case '!':
2345
+                $newToken['type'] = 'T_BOOLEAN_NOT';
2346
+                break;
2347
+            case ',':
2348
+                $newToken['type'] = 'T_COMMA';
2349
+                break;
2350
+            case '@':
2351
+                $newToken['type'] = 'T_ASPERAND';
2352
+                break;
2353
+            case '$':
2354
+                $newToken['type'] = 'T_DOLLAR';
2355
+                break;
2356
+            case '`':
2357
+                $newToken['type'] = 'T_BACKTICK';
2358
+                break;
2359
+            default:
2360
+                $newToken['type'] = 'T_NONE';
2361
+                break;
2362 2362
         }//end switch
2363 2363
 
2364 2364
         $newToken['code']    = constant($newToken['type']);
Please login to merge, or discard this patch.
vendor/squizlabs/php_codesniffer/src/Util/Common.php 1 patch
Switch Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -404,19 +404,19 @@
 block discarded – undo
404 404
         } else {
405 405
             $lowerVarType = strtolower($varType);
406 406
             switch ($lowerVarType) {
407
-            case 'bool':
408
-            case 'boolean':
409
-                return 'boolean';
410
-            case 'double':
411
-            case 'real':
412
-            case 'float':
413
-                return 'float';
414
-            case 'int':
415
-            case 'integer':
416
-                return 'integer';
417
-            case 'array()':
418
-            case 'array':
419
-                return 'array';
407
+                case 'bool':
408
+                case 'boolean':
409
+                    return 'boolean';
410
+                case 'double':
411
+                case 'real':
412
+                case 'float':
413
+                    return 'float';
414
+                case 'int':
415
+                case 'integer':
416
+                    return 'integer';
417
+                case 'array()':
418
+                case 'array':
419
+                    return 'array';
420 420
             }//end switch
421 421
 
422 422
             if (strpos($lowerVarType, 'array(') !== false) {
Please login to merge, or discard this patch.
php_codesniffer/src/Standards/PEAR/Tests/WhiteSpace/ScopeIndentUnitTest.inc 1 patch
Switch Indentation   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -32,8 +32,8 @@  discard block
 block discarded – undo
32 32
     function hello3()
33 33
     {
34 34
         switch ($hello) {
35
-        case 'hello':
36
-            break;
35
+            case 'hello':
36
+                break;
37 37
         }
38 38
     }
39 39
 
@@ -79,20 +79,20 @@  discard block
 block discarded – undo
79 79
             } else if (FALSE) {
80 80
                 foreach ($tokens as $token) {
81 81
                     switch ($token) {
82
-                    case '1':
83
-                    case '2':
84
-                        if (true) {
85
-                            if (false) {
82
+                        case '1':
83
+                        case '2':
84
+                            if (true) {
86 85
                                 if (false) {
87 86
                                     if (false) {
88
-                                        echo 'hello';
87
+                                        if (false) {
88
+                                            echo 'hello';
89
+                                        }
89 90
                                     }
90 91
                                 }
91 92
                             }
92
-                        }
93
-                    break;
94
-                    case '5':
95 93
                         break;
94
+                        case '5':
95
+                            break;
96 96
                     }
97 97
                     do {
98 98
                         while (true) {
@@ -161,20 +161,20 @@  discard block
 block discarded – undo
161 161
                 $last = count($ts) - 1;
162 162
 
163 163
                 switch ($token) {
164
-                case '(':
164
+                    case '(':
165 165
 
166
-                    if ($last >= 3 &&
167
-                        $ts[0]['token'] != T_CLASS &&
168
-                        $ts[$last - 2]['token'] == T_OBJECT_OPERATOR &&
169
-                        $ts[$last - 3]['token'] == T_VARIABLE ) {
166
+                        if ($last >= 3 &&
167
+                            $ts[0]['token'] != T_CLASS &&
168
+                            $ts[$last - 2]['token'] == T_OBJECT_OPERATOR &&
169
+                            $ts[$last - 3]['token'] == T_VARIABLE ) {
170 170
 
171 171
 
172
-                        if (true) {
173
-                            echo 'hello';
172
+                            if (true) {
173
+                                echo 'hello';
174
+                            }
174 175
                         }
175
-                    }
176
-                    array_push($braces, $token);
177
-                    break;
176
+                        array_push($braces, $token);
177
+                        break;
178 178
                 }
179 179
             }
180 180
         }
@@ -256,19 +256,19 @@  discard block
 block discarded – undo
256 256
 switch ($foo) {
257 257
 case 1:
258 258
     switch ($bar) {
259
-    default:
260
-        echo $string{1};
259
+        default:
260
+            echo $string{1};
261 261
     }
262 262
     break;
263 263
 }
264 264
 
265 265
 function temp($foo, $bar) {
266 266
     switch ($foo) {
267
-    case 1:
268
-        switch ($bar) {
269
-        default:
270
-            return $foo;
271
-        }
267
+        case 1:
268
+            switch ($bar) {
269
+                default:
270
+                    return $foo;
271
+            }
272 272
         break;
273 273
     }
274 274
 }
Please login to merge, or discard this patch.
src/Standards/PEAR/Tests/WhiteSpace/ScopeClosingBraceUnitTest.inc 1 patch
Switch Indentation   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -48,18 +48,18 @@  discard block
 block discarded – undo
48 48
 switch ($foo) {
49 49
 case 1:
50 50
     switch ($bar) {
51
-    default:
52
-        if ($something) {
53
-            echo $string{1};
54
-        } else if ($else) {
55
-            switch ($else) {
56
-            case 1:
57
-                // Do something.
58
-                break;
59
-            default:
60
-                // Do something.
61
-            break;
62
-            }
51
+        default:
52
+            if ($something) {
53
+                echo $string{1};
54
+            } else if ($else) {
55
+                switch ($else) {
56
+                    case 1:
57
+                        // Do something.
58
+                        break;
59
+                    default:
60
+                        // Do something.
61
+                    break;
62
+                }
63 63
         }
64 64
     }
65 65
 break;
@@ -69,11 +69,11 @@  discard block
 block discarded – undo
69 69
 }
70 70
 
71 71
 switch ($httpResponseCode) {
72
-    case 100:
73
-    case 101:
74
-    case 102:
75
-    default:
76
-        return 'Unknown';
72
+        case 100:
73
+        case 101:
74
+        case 102:
75
+        default:
76
+            return 'Unknown';
77 77
 }
78 78
 
79 79
 switch ($httpResponseCode) {
Please login to merge, or discard this patch.