Skip to content

Commit

Permalink
Implement code review suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigoprimo committed Oct 10, 2024
1 parent 498983d commit e4fb292
Showing 1 changed file with 22 additions and 17 deletions.
39 changes: 22 additions & 17 deletions src/Standards/Generic/Docs/Arrays/ArrayIndentStandard.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<documentation title="Array Indent">
<standard>
<![CDATA[
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.
The opening brace of a multi-line array must be indented at least to the same level as the start of the statement.
]]>
</standard>
<code_comparison>
<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.">
<code title="Valid: Opening brace of a multi-line array indented at least to the same level as the start of the statement.">
<![CDATA[
if ($condition) {
$a =
Expand All @@ -14,9 +14,14 @@ if ($condition) {
2,
];
}
$b = <em>[</em>
1,
2,
];
]]>
</code>
<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.">
<code title="Invalid: Opening brace of a multi-line array not indented at least to the same level as the start of the statement.">
<![CDATA[
if ($condition) {
$a =
Expand All @@ -30,44 +35,44 @@ if ($condition) {
</code_comparison>
<standard>
<![CDATA[
The elements of an array must be indented four spaces beyond the indentation level of the opening square bracket/parenthesis.
The first line of each array element must be indented exactly four spaces more than the start of the statement.
]]>
</standard>
<code_comparison>
<code title="Valid: Elements of an array indented four spaces beyond the indentation level of the opening square bracket/parenthesis.">
<code title="Valid: First line of each array element indented exactly four spaces more than the start of the statement.">
<![CDATA[
$a = array(
<em> 1</em>,
<em> 2</em>,
<em> 3</em>,
<em> </em>1,
<em> </em>2,
<em> </em>3,
);
]]>
</code>
<code title="Invalid: Elements of an array not indented four spaces beyond the indentation level of the opening square bracket/parenthesis.">
<code title="Invalid: First line of each array element not indented exactly four spaces more than the start of the statement.">
<![CDATA[
$a = array(
<em> 1</em>,
<em> </em>1,
2,
<em> 3</em>,
<em> </em>3,
);
]]>
</code>
</code_comparison>
<standard>
<![CDATA[
There must be a newline before the array closing square bracket/parenthesis.
There must be a newline before the array closing brace.
]]>
</standard>
<code_comparison>
<code title="Valid: Newline before the array closing square bracket/parenthesis.">
<code title="Valid: Newline before the array closing brace.">
<![CDATA[
$a = [
1,
2,<em>
]</em>;
]]>
</code>
<code title="Invalid: No newline before the array closing square bracket/parenthesis.">
<code title="Invalid: No newline before the array closing brace.">
<![CDATA[
$a = [
1,
Expand All @@ -77,19 +82,19 @@ $a = [
</code_comparison>
<standard>
<![CDATA[
The closing square bracket/parenthesis must be indented four spaces less than the array elements.
The closing brace must be on the same level of indentation as the start of the statement containing the array opener.
]]>
</standard>
<code_comparison>
<code title="Valid: Closing square bracket/parenthesis indented four spaces less than the array elements.">
<code title="Valid: Closing brace on the same level of indentation as the start of the statement containing the array opener.">
<![CDATA[
$a = array(
1,
2,
<em>)</em>;
]]>
</code>
<code title="Invalid: Closing square bracket/parenthesis not indented four spaces less than the array elements.">
<code title="Invalid: Closing brace not on the same level of indentation as the start of the statement containing the array opener.">
<![CDATA[
$a = array(
1,
Expand Down

0 comments on commit e4fb292

Please sign in to comment.