Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F10360434
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/src/lint/linter/__tests__/xhpast/switches.lint-test b/src/lint/linter/__tests__/xhpast/switches.lint-test
index e0420516..57c4a2ef 100644
--- a/src/lint/linter/__tests__/xhpast/switches.lint-test
+++ b/src/lint/linter/__tests__/xhpast/switches.lint-test
@@ -1,53 +1,69 @@
<?php
$x = 0;
$y = 0;
switch ($x) {
case 1:
$x++;
continue;
case 2:
$x++;
break;
case 3:
$x++;
return;
case 4:
$x++;
throw new Exception("!");
case 5:
break 2;
case 6:
continue 2;
case 7:
case 8:
$x++;
break;
case 9:
$x++;
/* fallthrough */
case 10:
$x++;
break;
case 11:
$x++;
exit(1);
default:
break;
}
switch ($x) {
case 1:
$x++;
case 2:
break;
}
switch ($x) {
default:
$x++;
}
+
+switch ($x) {
+ case 1:
+ while (true) {
+ break;
+ }
+ // TODO: false negative
+ case 2:
+ switch ($y) {
+ case 1:
+ break;
+ }
+ // TODO: false negative
+}
~~~~~~~~~~
warning:41:3
warning:48:3
+disabled:57:8
+disabled:63:8
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Sat, Nov 8, 06:37 (1 d, 17 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1034208
Default Alt Text
(1 KB)
Attached To
Mode
R118 Arcanist - fork
Attached
Detach File
Event Timeline
Log In to Comment