multiline_whitespace_before_semicolons.rst 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. ===============================================
  2. Rule ``multiline_whitespace_before_semicolons``
  3. ===============================================
  4. Forbid multi-line whitespace before the closing semicolon or move the semicolon
  5. to the new line for chained calls.
  6. Configuration
  7. -------------
  8. ``strategy``
  9. ~~~~~~~~~~~~
  10. Forbid multi-line whitespace or move the semicolon to the new line for chained
  11. calls.
  12. Allowed values: ``'new_line_for_chained_calls'`` and ``'no_multi_line'``
  13. Default value: ``'no_multi_line'``
  14. Examples
  15. --------
  16. Example #1
  17. ~~~~~~~~~~
  18. *Default* configuration.
  19. .. code-block:: diff
  20. --- Original
  21. +++ New
  22. <?php
  23. function foo() {
  24. - return 1 + 2
  25. - ;
  26. + return 1 + 2;
  27. }
  28. Example #2
  29. ~~~~~~~~~~
  30. With configuration: ``['strategy' => 'new_line_for_chained_calls']``.
  31. .. code-block:: diff
  32. --- Original
  33. +++ New
  34. <?php
  35. $object->method1()
  36. ->method2()
  37. - ->method(3);
  38. + ->method(3)
  39. +;
  40. Rule sets
  41. ---------
  42. The rule is part of the following rule set:
  43. - `@PhpCsFixer <./../../ruleSets/PhpCsFixer.rst>`_ with config:
  44. ``['strategy' => 'new_line_for_chained_calls']``