array_indentation.rst 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. ==========================
  2. Rule ``array_indentation``
  3. ==========================
  4. Each element of an array must be indented exactly once.
  5. Examples
  6. --------
  7. Example #1
  8. ~~~~~~~~~~
  9. .. code-block:: diff
  10. --- Original
  11. +++ New
  12. <?php
  13. $foo = [
  14. - 'bar' => [
  15. - 'baz' => true,
  16. - ],
  17. + 'bar' => [
  18. + 'baz' => true,
  19. + ],
  20. ];
  21. Rule sets
  22. ---------
  23. The rule is part of the following rule sets:
  24. - `@PER <./../../ruleSets/PER.rst>`_
  25. - `@PER-CS <./../../ruleSets/PER-CS.rst>`_
  26. - `@PER-CS2.0 <./../../ruleSets/PER-CS2.0.rst>`_
  27. - `@PhpCsFixer <./../../ruleSets/PhpCsFixer.rst>`_
  28. - `@Symfony <./../../ruleSets/Symfony.rst>`_
  29. References
  30. ----------
  31. - Fixer class: `PhpCsFixer\\Fixer\\Whitespace\\ArrayIndentationFixer <./../../../src/Fixer/Whitespace/ArrayIndentationFixer.php>`_
  32. - Test class: `PhpCsFixer\\Tests\\Fixer\\Whitespace\\ArrayIndentationFixerTest <./../../../tests/Fixer/Whitespace/ArrayIndentationFixerTest.php>`_
  33. The test class defines officially supported behaviour. Each test case is a part of our backward compatibility promise.