no_spaces_inside_parenthesis.rst 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. =====================================
  2. Rule ``no_spaces_inside_parenthesis``
  3. =====================================
  4. There MUST NOT be a space after the opening parenthesis. There MUST NOT be a
  5. space before the closing parenthesis.
  6. Warning
  7. -------
  8. This rule is deprecated and will be removed in the next major version
  9. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  10. You should use ``spaces_inside_parentheses`` instead.
  11. Examples
  12. --------
  13. Example #1
  14. ~~~~~~~~~~
  15. .. code-block:: diff
  16. --- Original
  17. +++ New
  18. <?php
  19. -if ( $a ) {
  20. - foo( );
  21. +if ($a) {
  22. + foo();
  23. }
  24. Example #2
  25. ~~~~~~~~~~
  26. .. code-block:: diff
  27. --- Original
  28. +++ New
  29. <?php
  30. -function foo( $bar, $baz )
  31. +function foo($bar, $baz)
  32. {
  33. }
  34. References
  35. ----------
  36. - Fixer class: `PhpCsFixer\\Fixer\\Whitespace\\NoSpacesInsideParenthesisFixer <./../../../src/Fixer/Whitespace/NoSpacesInsideParenthesisFixer.php>`_
  37. - Test class: `PhpCsFixer\\Tests\\Fixer\\Whitespace\\NoSpacesInsideParenthesisFixerTest <./../../../tests/Fixer/Whitespace/NoSpacesInsideParenthesisFixerTest.php>`_
  38. The test class defines officially supported behaviour. Each test case is a part of our backward compatibility promise.