11<documentation title =" Array Indent" >
22 <standard >
33 <![CDATA[
4- The opening square bracket/parenthesis of a multi-line array must be indented at least to the same level of the start of the statement.
4+ The opening brace of a multi-line array must be indented at least to the same level as the start of the statement.
55 ]]>
66 </standard >
77 <code_comparison >
8- <code title =" Valid: Opening square bracket/parenthesis token of a multi-line array indented at least to the same level as the start of the statement." >
8+ <code title =" Valid: Opening brace of a multi-line array indented at least to the same level as the start of the statement." >
99 <![CDATA[
1010if ($condition) {
1111 $a =
@@ -14,9 +14,14 @@ if ($condition) {
1414 2,
1515 ];
1616}
17+
18+ $b = <em>[</em>
19+ 1,
20+ 2,
21+ ];
1722 ]]>
1823 </code >
19- <code title =" Invalid: Opening square bracket/parenthesis of a multi-line array not indented at least to the same level as the start of the statement." >
24+ <code title =" Invalid: Opening brace of a multi-line array not indented at least to the same level as the start of the statement." >
2025 <![CDATA[
2126if ($condition) {
2227 $a =
@@ -30,44 +35,44 @@ if ($condition) {
3035 </code_comparison >
3136 <standard >
3237 <![CDATA[
33- The elements of an array must be indented four spaces beyond the indentation level of the opening square bracket/parenthesis .
38+ The first line of each array element must be indented exactly four spaces more than the start of the statement .
3439 ]]>
3540 </standard >
3641 <code_comparison >
37- <code title =" Valid: Elements of an array indented four spaces beyond the indentation level of the opening square bracket/parenthesis ." >
42+ <code title =" Valid: First line of each array element indented exactly four spaces more than the start of the statement ." >
3843 <![CDATA[
3944$a = array(
40- <em> 1 </em>,
41- <em> 2 </em>,
42- <em> 3 </em>,
45+ <em> </em>1 ,
46+ <em> </em>2 ,
47+ <em> </em>3 ,
4348);
4449 ]]>
4550 </code >
46- <code title =" Invalid: Elements of an array not indented four spaces beyond the indentation level of the opening square bracket/parenthesis ." >
51+ <code title =" Invalid: First line of each array element not indented exactly four spaces more than the start of the statement ." >
4752 <![CDATA[
4853$a = array(
49- <em> 1 </em>,
54+ <em> </em>1 ,
5055 2,
51- <em> 3 </em>,
56+ <em> </em>3 ,
5257);
5358 ]]>
5459 </code >
5560 </code_comparison >
5661 <standard >
5762 <![CDATA[
58- There must be a newline before the array closing square bracket/parenthesis .
63+ There must be a newline before the array closing brace .
5964 ]]>
6065 </standard >
6166 <code_comparison >
62- <code title =" Valid: Newline before the array closing square bracket/parenthesis ." >
67+ <code title =" Valid: Newline before the array closing brace ." >
6368 <![CDATA[
6469$a = [
6570 1,
6671 2,<em>
6772]</em>;
6873 ]]>
6974 </code >
70- <code title =" Invalid: No newline before the array closing square bracket/parenthesis ." >
75+ <code title =" Invalid: No newline before the array closing brace ." >
7176 <![CDATA[
7277$a = [
7378 1,
@@ -77,19 +82,19 @@ $a = [
7782 </code_comparison >
7883 <standard >
7984 <![CDATA[
80- The closing square bracket/parenthesis must be indented four spaces less than the array elements .
85+ The closing brace must be on the same level of indentation as the start of the statement containing the array opener .
8186 ]]>
8287 </standard >
8388 <code_comparison >
84- <code title =" Valid: Closing square bracket/parenthesis indented four spaces less than the array elements ." >
89+ <code title =" Valid: Closing brace on the same level of indentation as the start of the statement containing the array opener ." >
8590 <![CDATA[
8691$a = array(
8792 1,
8893 2,
8994<em>)</em>;
9095 ]]>
9196 </code >
92- <code title =" Invalid: Closing square bracket/parenthesis not indented four spaces less than the array elements ." >
97+ <code title =" Invalid: Closing brace not on the same level of indentation as the start of the statement containing the array opener ." >
9398 <![CDATA[
9499$a = array(
95100 1,
0 commit comments