Feature #38687
Create sniff for Array-Item-Declarations
| Status: | New | Start date: | 2012-07-05 | |
|---|---|---|---|---|
| Priority: | Should have | Due date: | ||
| Assignee: | - | % Done: | 0% |
|
| Category: | Arrays | Spent time: | - | |
| Target version: | 0.0.7 | |||
| Branch: | v4 | Tags: | ||
| Votes: | 0 |
Description
The CGl says about the Array item declaration
Array components are declared each on a separate line. Such lines are indented with one more tab than the start of the declaration. The closing bracket is on the same indentation level as the variable. Every line containing an array item ends with a comma. This may be omitted if there are no further elements, at the developer's choice. Example:
<pre>
$thisIsAnArray = array(
'foo' => 'bar',
'baz' => array(
0 => 1
)
);
</pre>
Nested arrays follow the same pattern. This formatting applies even to very small and simple array declarations, e.g.
<pre>
$a = array(
0 => 'b',
);
</pre>
Lets create a sniff :)
Related issues
| related to PHP_CodeSniffer - Feature #38686: Create sniff for Array-Declaration | Accepted | 2012-07-05 |
History
Updated by Stefano Kowalke 8 months ago
- Target version set to 0.0.5
Updated by Stefano Kowalke 8 months ago
- Target version changed from 0.0.5 to 0.0.6
Updated by Stefano Kowalke 15 days ago
- Target version changed from 0.0.6 to 0.0.7