File tree Expand file tree Collapse file tree
WordPress/Docs/CodeAnalysis Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11<?xml version =" 1.0" ?>
22<documentation xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
3- xsi : noNamespaceSchemaLocation =" https://phpcsstandards.github.io/PHPCSDevTools/phpcsdocs.xsd"
3+ xsi : noNamespaceSchemaLocation =" https://phpcsstandards.github.io/PHPCSDevTools/phpcsdocs.xsd"
44 title =" Assignment In Ternary Condition"
55 >
66 <standard >
77 <![CDATA[
8- Variables should not be assigned in conditional statement of ternary.
9- Condition must be in parentheses to be checked; ternaries lacking parentheses around condition are skipped.
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.
1010 ]]>
1111 </standard >
1212 <code_comparison >
1313 <code title =" Valid: Conditional statement in parentheses and does not include variable assignment." >
1414 <![CDATA[
15- $mode = ( $a <em>==</em> 'a' ) ? 'b' : 'c';
15+ $mode = ( $a <em>= ==</em> 'a' ) ? 'b' : 'c';
1616 ]]>
1717 </code >
1818 <code title =" Invalid: Conditional statement in parentheses but includes variable assignment instead of comparison." >
1919 <![CDATA[
20- $mode = ( $a <em>=</em> 'a' ) ? 'b' : 'c';
20+ $mode = ( $a <em>=</em> 'a' ) ? 'b' : 'c';
2121 ]]>
2222 </code >
2323 </code_comparison >
You can’t perform that action at this time.
0 commit comments