File tree Expand file tree Collapse file tree 1 file changed +101
-0
lines changed
src/Standards/Generic/Docs/Arrays Expand file tree Collapse file tree 1 file changed +101
-0
lines changed Original file line number Diff line number Diff line change 1+ <documentation title =" Array Indent" >
2+ <standard >
3+ <![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.
5+ ]]>
6+ </standard >
7+ <code_comparison >
8+ <code title =" Valid: Opening square bracket/parenthesis token of a multi-line array indented at least to the same level of the start of the statement." >
9+ <![CDATA[
10+ if ($condition) {
11+ $a =
12+ <em> [</em>
13+ 1,
14+ 2,
15+ ];
16+ }
17+ ]]>
18+ </code >
19+ <code title =" Invalid: Opening square bracket/parenthesis of a multi-line array not indented at least to the same level of the start of the statement." >
20+ <![CDATA[
21+ if ($condition) {
22+ $a =
23+ <em>[</em>
24+ 1,
25+ 2,
26+ ];
27+ }
28+ ]]>
29+ </code >
30+ </code_comparison >
31+ <standard >
32+ <![CDATA[
33+ The elements of an array must be indented four spaces beyond the indentation level of the opening square bracket/parenthesis.
34+ ]]>
35+ </standard >
36+ <code_comparison >
37+ <code title =" Valid: Elements of an array indented four spaces beyond the indentation level of the opening square bracket/parenthesis." >
38+ <![CDATA[
39+ $a = array(
40+ <em> 1</em>,
41+ <em> 2</em>,
42+ <em> 3</em>,
43+ );
44+ ]]>
45+ </code >
46+ <code title =" Invalid: Elements of an array not indented four spaces beyond the indentation level of the opening square bracket/parenthesis." >
47+ <![CDATA[
48+ $a = array(
49+ <em> 1</em>,
50+ 2,
51+ <em> 3</em>,
52+ );
53+ ]]>
54+ </code >
55+ </code_comparison >
56+ <standard >
57+ <![CDATA[
58+ There must be a newline before the array closing square bracket/parenthesis.
59+ ]]>
60+ </standard >
61+ <code_comparison >
62+ <code title =" Valid: Newline before the array closing square bracket/parenthesis." >
63+ <![CDATA[
64+ $a = [
65+ 1,
66+ 2,<em>
67+ ]</em>;
68+ ]]>
69+ </code >
70+ <code title =" Invalid: No newline before the array closing square bracket/parenthesis." >
71+ <![CDATA[
72+ $a = [
73+ 1,
74+ 2,<em>]</em>;
75+ ]]>
76+ </code >
77+ </code_comparison >
78+ <standard >
79+ <![CDATA[
80+ The closing square bracket/parenthesis must be indented four spaces less than the array elements.
81+ ]]>
82+ </standard >
83+ <code_comparison >
84+ <code title =" Valid: Closing square bracket/parenthesis indented four spaces less than the array elements." >
85+ <![CDATA[
86+ $a = array(
87+ 1,
88+ 2,
89+ <em>)</em>;
90+ ]]>
91+ </code >
92+ <code title =" Invalid: Closing square bracket/parenthesis not indented four spaces less than the array elements." >
93+ <![CDATA[
94+ $a = array(
95+ 1,
96+ 2,
97+ <em> )</em>;
98+ ]]>
99+ </code >
100+ </code_comparison >
101+ </documentation >
You can’t perform that action at this time.
0 commit comments