concat_space.rst 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. =====================
  2. Rule ``concat_space``
  3. =====================
  4. Concatenation should be spaced according to configuration.
  5. Configuration
  6. -------------
  7. ``spacing``
  8. ~~~~~~~~~~~
  9. Spacing to apply around concatenation operator.
  10. Allowed values: ``'none'`` and ``'one'``
  11. Default value: ``'none'``
  12. Examples
  13. --------
  14. Example #1
  15. ~~~~~~~~~~
  16. *Default* configuration.
  17. .. code-block:: diff
  18. --- Original
  19. +++ New
  20. <?php
  21. -$foo = 'bar' . 3 . 'baz'.'qux';
  22. +$foo = 'bar'. 3 .'baz'.'qux';
  23. Example #2
  24. ~~~~~~~~~~
  25. With configuration: ``['spacing' => 'none']``.
  26. .. code-block:: diff
  27. --- Original
  28. +++ New
  29. <?php
  30. -$foo = 'bar' . 3 . 'baz'.'qux';
  31. +$foo = 'bar'. 3 .'baz'.'qux';
  32. Example #3
  33. ~~~~~~~~~~
  34. With configuration: ``['spacing' => 'one']``.
  35. .. code-block:: diff
  36. --- Original
  37. +++ New
  38. <?php
  39. -$foo = 'bar' . 3 . 'baz'.'qux';
  40. +$foo = 'bar' . 3 . 'baz' . 'qux';
  41. Rule sets
  42. ---------
  43. The rule is part of the following rule sets:
  44. - `@PER <./../../ruleSets/PER.rst>`_ with config:
  45. ``['spacing' => 'one']``
  46. - `@PER-CS2.0 <./../../ruleSets/PER-CS2.0.rst>`_ with config:
  47. ``['spacing' => 'one']``
  48. - `@PhpCsFixer <./../../ruleSets/PhpCsFixer.rst>`_
  49. - `@Symfony <./../../ruleSets/Symfony.rst>`_