You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When accessing linfo, two warnings are spilled out:
Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /srv/http/linfo/src/Linfo/OS/Linux.php on line 1034
Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /srv/http/linfo/src/Linfo/OS/Linux.php on line 1351
The fix is simply to delete the "continue" from the switch-case.
UPDATE: considering the logic, it makes more sense to break out to the upper switch.
diff --git a/src/Linfo/OS/Linux.php b/src/Linfo/OS/Linux.php
index d77ef91..66a6447 100644
--- a/src/Linfo/OS/Linux.php
+++ b/src/Linfo/OS/Linux.php
@@ -1031,7 +1031,7 @@ class Linux extends Unixcommon
$charge_now = Common::getIntFromFile($b.'/charge_now');break;
default:
- continue;
+ continue 2;break;
}
@@ -1348,7 +1348,7 @@ class Linux extends Unixcommon
$state = 'Up (Stopped)';break;
default:
- continue;
+ continue 3;break;
}
break;
The text was updated successfully, but these errors were encountered:
When accessing linfo, two warnings are spilled out:
Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /srv/http/linfo/src/Linfo/OS/Linux.php on line 1034
Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /srv/http/linfo/src/Linfo/OS/Linux.php on line 1351
The fix is simply to delete the "continue" from the switch-case.
UPDATE: considering the logic, it makes more sense to break out to the upper switch.
The text was updated successfully, but these errors were encountered: