Skip to content

Commit af0ce75

Browse files
committed
Docs for WordPress.Arrays.MultipleStatementAlignment
1 parent 00c0cea commit af0ce75

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<documentation title="Multiple Statement Alignment">
2+
<standard>
3+
<![CDATA[
4+
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.
5+
]]>
6+
</standard>
7+
<code_comparison>
8+
<code title="Valid: Double arrow operators aligned">
9+
<![CDATA[
10+
$args = array(
11+
'cat' <em>=></em> 22,
12+
'year' <em>=></em> $current_year,
13+
'monthnum' <em>=></em> $current_month,
14+
'order' <em>=></em> 'ASC',
15+
);
16+
]]>
17+
</code>
18+
<code title="Invalid: Not aligned; harder to read">
19+
<![CDATA[
20+
$args = array(
21+
'cat' <em>=></em> 22,
22+
'year' <em>=></em> $current_year,
23+
'monthnum' <em>=></em> $current_month,
24+
'order' <em>=></em> 'ASC',
25+
);
26+
]]>
27+
</code>
28+
</code_comparison>
29+
</documentation>

0 commit comments

Comments
 (0)