Skip to content

Commit

Permalink
enforce indentation of array items (#31)
Browse files Browse the repository at this point in the history
* enforce indentation of array items

* don't allow blank lines after and before array braces (and others)

* add an invalid fixture
  • Loading branch information
rieschl authored Oct 12, 2023
1 parent 98ac273 commit da033f0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
6 changes: 6 additions & 0 deletions php-cs-fixer-rules.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

return [
'@PSR12' => true,
'array_indentation' => true,
'array_syntax' => true,
'binary_operator_spaces' => true,
'cast_spaces' => [
Expand Down Expand Up @@ -42,7 +43,12 @@
'no_empty_phpdoc' => true,
'no_extra_blank_lines' => [
'tokens' => [
'continue',
'extra',
'parenthesis_brace_block',
'return',
'square_brace_block',
'throw',
'use',
],
],
Expand Down
9 changes: 9 additions & 0 deletions tests/fixtures/invalid/array-indentation.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php

declare(strict_types=1);

$foo = [

'invalid' => 'i am invalid',

];

0 comments on commit da033f0

Please sign in to comment.