File tree Expand file tree Collapse file tree 1 file changed +58
-0
lines changed
Expand file tree Collapse file tree 1 file changed +58
-0
lines changed Original file line number Diff line number Diff line change 1+ <?xml version =" 1.0" ?>
2+ <documentation xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
3+ xsi : noNamespaceSchemaLocation =" https://phpcsstandards.github.io/PHPCSDevTools/phpcsdocs.xsd"
4+ title =" Array Declaration Spacing"
5+ >
6+ <standard >
7+ <![CDATA[
8+ Multi-item arrays with explicit keys must be declared as multi-line arrays.
9+ ]]>
10+ </standard >
11+ <code_comparison >
12+ <code title =" Valid: Multi-item array with explicit keys declared as multi-line." >
13+ <![CDATA[
14+ $args = array(
15+ <em>'cat' => 1</em>,
16+ <em>'paged' => 2</em>,
17+ );
18+ ]]>
19+ </code >
20+ <code title =" Invalid: Single line multi-item array with explicit keys." >
21+ <![CDATA[
22+ $args = array( <em>'cat' => 1, 'paged' => 2</em> );
23+ ]]>
24+ </code >
25+ </code_comparison >
26+ <standard >
27+ <![CDATA[
28+ Each item in a multi-line array must be on a new line.
29+ ]]>
30+ </standard >
31+ <code_comparison >
32+ <code title =" Valid: Only one array item per line." >
33+ <![CDATA[
34+ $post_types = array(
35+ <em>'post'</em>,
36+ <em>'page'</em>,
37+ );
38+
39+ $args = array(
40+ <em>'cat' => 1</em>,
41+ <em>'paged' => 2</em>,
42+ );
43+ ]]>
44+ </code >
45+ <code title =" Invalid: More than one item per line in a multi-line array." >
46+ <![CDATA[
47+ $post_types = array(
48+ <em>'post', 'page'</em>,
49+ );
50+
51+
52+ $args = array(
53+ <em>'cat' => 1, 'paged' => 2</em>,
54+ );
55+ ]]>
56+ </code >
57+ </code_comparison >
58+ </documentation >
You can’t perform that action at this time.
0 commit comments