Skip to content

Commit

Permalink
Docs for WordPress.Arrays.MultipleStatementAlignment
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike-Hermans committed Jun 28, 2019
1 parent 00c0cea commit af0ce75
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions WordPress/Docs/Arrays/MultipleStatementAlignmentStandard.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<documentation title="Multiple Statement Alignment">
<standard>
<![CDATA[
There should be one space on either side of a double arrow operator used to assign a value to a key. In the case of a block of related assignments, more space may be inserted to promote readability.
]]>
</standard>
<code_comparison>
<code title="Valid: Double arrow operators aligned">
<![CDATA[
$args = array(
'cat' <em>=></em> 22,
'year' <em>=></em> $current_year,
'monthnum' <em>=></em> $current_month,
'order' <em>=></em> 'ASC',
);
]]>
</code>
<code title="Invalid: Not aligned; harder to read">
<![CDATA[
$args = array(
'cat' <em>=></em> 22,
'year' <em>=></em> $current_year,
'monthnum' <em>=></em> $current_month,
'order' <em>=></em> 'ASC',
);
]]>
</code>
</code_comparison>
</documentation>

0 comments on commit af0ce75

Please sign in to comment.