rspec/rules/S1301/php/rule.adoc
2020-12-21 15:38:52 +01:00

25 lines
291 B
Plaintext

include::../description.adoc[]
== Noncompliant Code Example
----
switch ($variable) {
case 0:
do_something();
break;
default:
do_something_else();
break;
}
----
== Compliant Solution
----
if ($variable == 0) {
do_something();
} else {
do_something_else();
}
----