This repository was archived by the owner on Nov 21, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +39
-4
lines changed Expand file tree Collapse file tree 4 files changed +39
-4
lines changed Original file line number Diff line number Diff line change 1313 </rule >
1414
1515 <rule ref =" Generic.Arrays.DisallowLongArraySyntax" />
16+ <rule ref =" Generic.CodeAnalysis.EmptyStatement" >
17+ <exclude name =" Generic.CodeAnalysis.EmptyStatement.DetectedCatch" />
18+ </rule >
1619 <rule ref =" Generic.Commenting.Fixme" />
1720 <rule ref =" Generic.Commenting.Todo" />
1821 <rule ref =" Generic.Files.InlineHTML" />
Original file line number Diff line number Diff line change 1+ ---DESCRIPTION---
2+ Statements must not be empty, except catch blocks
3+ ---CONTENTS---
4+ <?php
5+
6+ declare(strict_types=1);
7+
8+ if ($foo) {
9+ // Bar
10+ } elseif ($baz) {
11+ // Qux
12+ } else {
13+ }
14+
15+ try {
16+ } catch (Exception $e) {
17+ } catch (Throwable $e) {
18+ // Corge
19+ } finally {
20+ }
21+
22+ ---MESSAGES---
23+ 5:1 Generic.CodeAnalysis.EmptyStatement.DetectedIf
24+ 7:3 Generic.CodeAnalysis.EmptyStatement.DetectedElseif
25+ 9:3 Generic.CodeAnalysis.EmptyStatement.DetectedElse
26+ 12:1 Generic.CodeAnalysis.EmptyStatement.DetectedTry
27+ 16:3 Generic.CodeAnalysis.EmptyStatement.DetectedFinally
28+ ---
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ declare(strict_types=1);
88list($foo, $bar) = [$baz, $qux];
99
1010foreach ($quux as list('quuz' => $corge, 'grault' => $plugh)) {
11+ break;
1112}
1213
1314---FIXED---
@@ -18,6 +19,7 @@ declare(strict_types=1);
1819[$foo, $bar] = [$baz, $qux];
1920
2021foreach ($quux as ['quuz' => $corge, 'grault' => $plugh]) {
22+ break;
2123}
2224
2325---
Original file line number Diff line number Diff line change @@ -6,14 +6,16 @@ TODO comments must not be used
66declare(strict_types=1);
77
88if ($foo) {
9- // TODO add code
9+ $bar = 'baz';
10+ // TODO add more code
1011}
1112
13+ // FIXME please
1214if ((1 + 1) === 3) {
13- // FIXME please
15+ $qux = 'quuz';
1416}
1517
1618---MESSAGES---
17- 6 :5 Generic.Commenting.Todo.TaskFound
18- 10:5 Generic.Commenting.Fixme.TaskFound
19+ 7 :5 Generic.Commenting.Todo.TaskFound
20+ 10:1 Generic.Commenting.Fixme.TaskFound
1921---
You can’t perform that action at this time.
0 commit comments