Skip to content

Commit da033f0

Browse files
authored
enforce indentation of array items (#31)
* enforce indentation of array items * don't allow blank lines after and before array braces (and others) * add an invalid fixture
1 parent 98ac273 commit da033f0

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

php-cs-fixer-rules.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
return [
66
'@PSR12' => true,
7+
'array_indentation' => true,
78
'array_syntax' => true,
89
'binary_operator_spaces' => true,
910
'cast_spaces' => [
@@ -42,7 +43,12 @@
4243
'no_empty_phpdoc' => true,
4344
'no_extra_blank_lines' => [
4445
'tokens' => [
46+
'continue',
4547
'extra',
48+
'parenthesis_brace_block',
49+
'return',
50+
'square_brace_block',
51+
'throw',
4652
'use',
4753
],
4854
],
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
$foo = [
6+
7+
'invalid' => 'i am invalid',
8+
9+
];

0 commit comments

Comments
 (0)