Skip to content

Commit 2f3cfcb

Browse files
committed
PSR2/SwitchDeclaration: update doc as case body should be non-empty
This commit updates the valid and invalid code examples in a `<code_comparison>` block, as the `There must be a comment when fall-through is intentional in a non-empty case body` error is only triggered for non-empty `case` bodies. It also fixes the positioning of the `<em>` tags in the modified code examples.
1 parent 25488bc commit 2f3cfcb

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/Standards/PSR2/Docs/ControlStructures/SwitchDeclarationStandard.xml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,9 @@ switch ($foo) {
6767
<![CDATA[
6868
switch ($foo) {
6969
case 'bar':
70-
<em>// no break</em>
71-
default<em></em>:
70+
echo $foo;
71+
<em>// no break</em>
72+
default:
7273
break;
7374
}
7475
]]>
@@ -77,7 +78,8 @@ switch ($foo) {
7778
<![CDATA[
7879
switch ($foo) {
7980
case 'bar':
80-
default<em></em>:
81+
echo $foo;<em></em>
82+
default:
8183
break;
8284
}
8385
]]>

0 commit comments

Comments
 (0)