trim_array_spaces.rst 995 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. ==========================
  2. Rule ``trim_array_spaces``
  3. ==========================
  4. Arrays should be formatted like function/method arguments, without leading or
  5. trailing single line space.
  6. Examples
  7. --------
  8. Example #1
  9. ~~~~~~~~~~
  10. .. code-block:: diff
  11. --- Original
  12. +++ New
  13. <?php
  14. -$sample = array( );
  15. -$sample = array( 'a', 'b' );
  16. +$sample = array();
  17. +$sample = array('a', 'b');
  18. Rule sets
  19. ---------
  20. The rule is part of the following rule sets:
  21. - `@PhpCsFixer <./../../ruleSets/PhpCsFixer.rst>`_
  22. - `@Symfony <./../../ruleSets/Symfony.rst>`_
  23. References
  24. ----------
  25. - Fixer class: `PhpCsFixer\\Fixer\\ArrayNotation\\TrimArraySpacesFixer <./../../../src/Fixer/ArrayNotation/TrimArraySpacesFixer.php>`_
  26. - Test class: `PhpCsFixer\\Tests\\Fixer\\ArrayNotation\\TrimArraySpacesFixerTest <./../../../tests/Fixer/ArrayNotation/TrimArraySpacesFixerTest.php>`_
  27. The test class defines officially supported behaviour. Each test case is a part of our backward compatibility promise.