File tree Expand file tree Collapse file tree 2 files changed +7
-0
lines changed
tests/Rule/data/ForbidUnusedExceptionRule Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change 7
7
use PhpParser \Node \ArrayItem ;
8
8
use PhpParser \Node \Expr \Assign ;
9
9
use PhpParser \Node \Expr \BinaryOp \Coalesce ;
10
+ use PhpParser \Node \Expr \ClassConstFetch ;
10
11
use PhpParser \Node \Expr \MethodCall ;
11
12
use PhpParser \Node \Expr \New_ ;
12
13
use PhpParser \Node \Expr \NullsafeMethodCall ;
@@ -94,6 +95,7 @@ private function isUsed(Node $parent): bool
94
95
|| $ parent instanceof Ternary
95
96
|| $ parent instanceof Yield_
96
97
|| $ parent instanceof Throw_
98
+ || $ parent instanceof ClassConstFetch
97
99
|| $ parent instanceof MatchArm;
98
100
}
99
101
Original file line number Diff line number Diff line change @@ -59,6 +59,11 @@ public function okUsage7(string $decide): void
59
59
};
60
60
}
61
61
62
+ public function okUsage8 (): void
63
+ {
64
+ echo $ this ->getException ()::class;
65
+ }
66
+
62
67
public function getExceptionAtRuntime (): RuntimeException
63
68
{
64
69
return new RuntimeException ();
You can’t perform that action at this time.
0 commit comments