concat_space.rst 1.3 KB

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