no_spaces_inside_parenthesis.rst 759 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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 on 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. }