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 13
13
</rule >
14
14
15
15
<rule ref =" Generic.Arrays.DisallowLongArraySyntax" />
16
+ <rule ref =" Generic.CodeAnalysis.EmptyStatement" >
17
+ <exclude name =" Generic.CodeAnalysis.EmptyStatement.DetectedCatch" />
18
+ </rule >
16
19
<rule ref =" Generic.Commenting.Fixme" />
17
20
<rule ref =" Generic.Commenting.Todo" />
18
21
<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);
8
8
list($foo, $bar) = [$baz, $qux];
9
9
10
10
foreach ($quux as list('quuz' => $corge, 'grault' => $plugh)) {
11
+ break;
11
12
}
12
13
13
14
---FIXED---
@@ -18,6 +19,7 @@ declare(strict_types=1);
18
19
[$foo, $bar] = [$baz, $qux];
19
20
20
21
foreach ($quux as ['quuz' => $corge, 'grault' => $plugh]) {
22
+ break;
21
23
}
22
24
23
25
---
Original file line number Diff line number Diff line change @@ -6,14 +6,16 @@ TODO comments must not be used
6
6
declare(strict_types=1);
7
7
8
8
if ($foo) {
9
- // TODO add code
9
+ $bar = 'baz';
10
+ // TODO add more code
10
11
}
11
12
13
+ // FIXME please
12
14
if ((1 + 1) === 3) {
13
- // FIXME please
15
+ $qux = 'quuz';
14
16
}
15
17
16
18
---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
19
21
---
You can’t perform that action at this time.
0 commit comments