Skip to content

Commit dd24ea3

Browse files
committed
Simplify code example titles and standard description text
1 parent 6f91a66 commit dd24ea3

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

WordPress/Docs/CodeAnalysis/AssignmentInTernaryConditionStandard.xml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,18 @@
55
>
66
<standard>
77
<![CDATA[
8-
Variables should not be assigned in the condition of a ternary expression.
9-
The condition must be in parentheses to be checked; ternaries lacking parentheses around the condition are skipped.
8+
Variables should not be assigned in the condition of a ternary expression. This is likely a mistake, as more often than not a comparison was intended.
9+
10+
Note: This sniff can only detect assignments when the ternary condition is wrapped in parentheses.
1011
]]>
1112
</standard>
1213
<code_comparison>
13-
<code title="Valid: Conditional statement in parentheses and does not include variable assignment.">
14+
<code title="Valid: Comparison operator used in ternary condition.">
1415
<![CDATA[
1516
$mode = ( $a <em>===</em> 'a' ) ? 'b' : 'c';
1617
]]>
1718
</code>
18-
<code title="Invalid: Conditional statement in parentheses but includes variable assignment instead of comparison.">
19+
<code title="Invalid: Assignment in parenthesized ternary condition.">
1920
<![CDATA[
2021
$mode = ( $a <em>=</em> 'a' ) ? 'b' : 'c';
2122
]]>

0 commit comments

Comments
 (0)